[172] | 1 | \hypertarget{classemix}{ |
---|
[30] | 2 | \section{emix Class Reference} |
---|
| 3 | \label{classemix}\index{emix@{emix}} |
---|
[172] | 4 | } |
---|
[106] | 5 | Mixture of epdfs. |
---|
[30] | 6 | |
---|
| 7 | |
---|
[106] | 8 | {\tt \#include $<$emix.h$>$} |
---|
[30] | 9 | |
---|
| 10 | Inheritance diagram for emix:\nopagebreak |
---|
| 11 | \begin{figure}[H] |
---|
| 12 | \begin{center} |
---|
| 13 | \leavevmode |
---|
[106] | 14 | \includegraphics[width=40pt]{classemix__inherit__graph} |
---|
[30] | 15 | \end{center} |
---|
| 16 | \end{figure} |
---|
| 17 | Collaboration diagram for emix:\nopagebreak |
---|
| 18 | \begin{figure}[H] |
---|
| 19 | \begin{center} |
---|
| 20 | \leavevmode |
---|
[106] | 21 | \includegraphics[width=40pt]{classemix__coll__graph} |
---|
[30] | 22 | \end{center} |
---|
| 23 | \end{figure} |
---|
| 24 | \subsection*{Public Member Functions} |
---|
| 25 | \begin{CompactItemize} |
---|
| 26 | \item |
---|
[181] | 27 | \hypertarget{classemix_62194619791d5f1da88cad01cfc9339d}{ |
---|
| 28 | \hyperlink{classemix_62194619791d5f1da88cad01cfc9339d}{emix} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv})} |
---|
| 29 | \label{classemix_62194619791d5f1da88cad01cfc9339d} |
---|
[30] | 30 | |
---|
| 31 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
[210] | 32 | void \hyperlink{classemix_d3789d50a3327a6de552db077af5e4c5}{set\_\-parameters} (const vec \&\hyperlink{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab}{w}, const Array$<$ \hyperlink{classepdf}{epdf} $\ast$ $>$ \&\hyperlink{classemix_7155d827417b53fb6aa5cff1459e6eb4}{Coms}, bool copy=true) |
---|
| 33 | \item |
---|
[172] | 34 | \hypertarget{classemix_0650601f24e633e0ab09aa1e46c14483}{ |
---|
| 35 | vec \hyperlink{classemix_0650601f24e633e0ab09aa1e46c14483}{sample} () const } |
---|
| 36 | \label{classemix_0650601f24e633e0ab09aa1e46c14483} |
---|
[30] | 37 | |
---|
[172] | 38 | \begin{CompactList}\small\item\em Returns a sample, $x$ from density $epdf(rv)$. \item\end{CompactList}\item |
---|
| 39 | \hypertarget{classemix_b662a51d042b062020460e64bff4e9e8}{ |
---|
| 40 | vec \hyperlink{classemix_b662a51d042b062020460e64bff4e9e8}{mean} () const } |
---|
| 41 | \label{classemix_b662a51d042b062020460e64bff4e9e8} |
---|
| 42 | |
---|
[106] | 43 | \begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item |
---|
[219] | 44 | \hypertarget{classemix_82691a72b583dab957cbd60d9283e47a}{ |
---|
| 45 | double \hyperlink{classemix_82691a72b583dab957cbd60d9283e47a}{evallog} (const vec \&val) const } |
---|
| 46 | \label{classemix_82691a72b583dab957cbd60d9283e47a} |
---|
[33] | 47 | |
---|
[106] | 48 | \begin{CompactList}\small\item\em Compute log-probability of argument {\tt val}. \item\end{CompactList}\item |
---|
[219] | 49 | \hypertarget{classemix_b3eb9e153e8bfdb6bb47adecc278cbca}{ |
---|
| 50 | vec \hyperlink{classemix_b3eb9e153e8bfdb6bb47adecc278cbca}{evallog\_\-m} (const mat \&Val) const } |
---|
| 51 | \label{classemix_b3eb9e153e8bfdb6bb47adecc278cbca} |
---|
[210] | 52 | |
---|
| 53 | \begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item |
---|
[219] | 54 | \hypertarget{classemix_44ae2b86c650c2ccb967969c1859d268}{ |
---|
| 55 | mat \hyperlink{classemix_44ae2b86c650c2ccb967969c1859d268}{evallog\_\-M} (const mat \&Val) const } |
---|
| 56 | \label{classemix_44ae2b86c650c2ccb967969c1859d268} |
---|
[210] | 57 | |
---|
[219] | 58 | \begin{CompactList}\small\item\em Auxiliary function that returns pdflog for each component. \item\end{CompactList}\item |
---|
[210] | 59 | \hypertarget{classemix_33afde698093d458ce71875f7ee7384a}{ |
---|
| 60 | \hyperlink{classemix}{emix} $\ast$ \hyperlink{classemix_33afde698093d458ce71875f7ee7384a}{marginal} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const } |
---|
| 61 | \label{classemix_33afde698093d458ce71875f7ee7384a} |
---|
| 62 | |
---|
| 63 | \begin{CompactList}\small\item\em Return marginal density on the given \hyperlink{classRV}{RV}, the remainig rvs are intergrated out. \item\end{CompactList}\item |
---|
| 64 | \hypertarget{classemix_ebf50c387034f72040c83d38738549b3}{ |
---|
| 65 | \hyperlink{classmratio}{mratio} $\ast$ \hyperlink{classemix_ebf50c387034f72040c83d38738549b3}{condition} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const } |
---|
| 66 | \label{classemix_ebf50c387034f72040c83d38738549b3} |
---|
| 67 | |
---|
| 68 | \begin{CompactList}\small\item\em Return conditional density on the given \hyperlink{classRV}{RV}, the remaining rvs will be in conditioning. \item\end{CompactList}\item |
---|
[172] | 69 | \hypertarget{classemix_35baf0f62307455cebfbf462144b4dd8}{ |
---|
| 70 | vec \& \hyperlink{classemix_35baf0f62307455cebfbf462144b4dd8}{\_\-w} ()} |
---|
| 71 | \label{classemix_35baf0f62307455cebfbf462144b4dd8} |
---|
[106] | 72 | |
---|
| 73 | \begin{CompactList}\small\item\em returns a pointer to the internal mean value. Use with Care! \item\end{CompactList}\item |
---|
[181] | 74 | \hypertarget{classemix_4d7baeb2a9e3fca1d8fd32a107df291d}{ |
---|
| 75 | void \hyperlink{classemix_4d7baeb2a9e3fca1d8fd32a107df291d}{ownComs} ()} |
---|
| 76 | \label{classemix_4d7baeb2a9e3fca1d8fd32a107df291d} |
---|
| 77 | |
---|
| 78 | \begin{CompactList}\small\item\em Auxiliary function for taking ownership of the \hyperlink{classemix_7155d827417b53fb6aa5cff1459e6eb4}{Coms()}. \item\end{CompactList}\item |
---|
[210] | 79 | \hypertarget{classemix_95d175b2daa1d896ceffd69b70e02efb}{ |
---|
| 80 | \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classemix_95d175b2daa1d896ceffd69b70e02efb}{\_\-Coms} (int i)} |
---|
| 81 | \label{classemix_95d175b2daa1d896ceffd69b70e02efb} |
---|
[106] | 82 | |
---|
[210] | 83 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
| 84 | \hypertarget{classepdf_76608914c3b19e150292d5c56e93e508}{ |
---|
| 85 | virtual mat \hyperlink{classepdf_76608914c3b19e150292d5c56e93e508}{sample\_\-m} (int N) const } |
---|
| 86 | \label{classepdf_76608914c3b19e150292d5c56e93e508} |
---|
| 87 | |
---|
[106] | 88 | \begin{CompactList}\small\item\em Returns N samples from density $epdf(rv)$. \item\end{CompactList}\item |
---|
[172] | 89 | \hypertarget{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{ |
---|
| 90 | const \hyperlink{classRV}{RV} \& \hyperlink{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{\_\-rv} () const } |
---|
| 91 | \label{classepdf_ca0d32aabb4cbba347e0c37fe8607562} |
---|
| 92 | |
---|
| 93 | \begin{CompactList}\small\item\em access function, possibly dangerous! \item\end{CompactList}\item |
---|
| 94 | \hypertarget{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{ |
---|
| 95 | void \hyperlink{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{\_\-renewrv} (const \hyperlink{classRV}{RV} \&in\_\-rv)} |
---|
| 96 | \label{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5} |
---|
| 97 | |
---|
| 98 | \begin{CompactList}\small\item\em modifier function - useful when copying epdfs \item\end{CompactList}\end{CompactItemize} |
---|
[30] | 99 | \subsection*{Protected Attributes} |
---|
| 100 | \begin{CompactItemize} |
---|
| 101 | \item |
---|
[172] | 102 | \hypertarget{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab}{ |
---|
| 103 | vec \hyperlink{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab}{w}} |
---|
| 104 | \label{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab} |
---|
[30] | 105 | |
---|
[106] | 106 | \begin{CompactList}\small\item\em weights of the components \item\end{CompactList}\item |
---|
[172] | 107 | \hypertarget{classemix_7155d827417b53fb6aa5cff1459e6eb4}{ |
---|
| 108 | Array$<$ \hyperlink{classepdf}{epdf} $\ast$ $>$ \hyperlink{classemix_7155d827417b53fb6aa5cff1459e6eb4}{Coms}} |
---|
| 109 | \label{classemix_7155d827417b53fb6aa5cff1459e6eb4} |
---|
[30] | 110 | |
---|
[106] | 111 | \begin{CompactList}\small\item\em Component (epdfs). \item\end{CompactList}\item |
---|
[181] | 112 | \hypertarget{classemix_7d0d863e6066ee02947914ff06ac34e8}{ |
---|
| 113 | bool \hyperlink{classemix_7d0d863e6066ee02947914ff06ac34e8}{destroyComs}} |
---|
| 114 | \label{classemix_7d0d863e6066ee02947914ff06ac34e8} |
---|
| 115 | |
---|
| 116 | \begin{CompactList}\small\item\em Flag if owning Coms. \item\end{CompactList}\item |
---|
[172] | 117 | \hypertarget{classepdf_74da992e3f5d598da8850b646b79b9d9}{ |
---|
| 118 | \hyperlink{classRV}{RV} \hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}} |
---|
| 119 | \label{classepdf_74da992e3f5d598da8850b646b79b9d9} |
---|
[30] | 120 | |
---|
[106] | 121 | \begin{CompactList}\small\item\em Identified of the random variable. \item\end{CompactList}\end{CompactItemize} |
---|
[30] | 122 | |
---|
| 123 | |
---|
| 124 | \subsection{Detailed Description} |
---|
[106] | 125 | Mixture of epdfs. |
---|
[30] | 126 | |
---|
[106] | 127 | Density function: \[ f(x) = \sum_{i=1}^{n} w_{i} f_i(x), \quad \sum_{i=1}^n w_i = 1. \] where $f_i(x)$ is any density on random variable $x$, called {\em component\/}, |
---|
| 128 | |
---|
[210] | 129 | \subsection{Member Function Documentation} |
---|
| 130 | \hypertarget{classemix_d3789d50a3327a6de552db077af5e4c5}{ |
---|
| 131 | \index{emix@{emix}!set\_\-parameters@{set\_\-parameters}} |
---|
| 132 | \index{set\_\-parameters@{set\_\-parameters}!emix@{emix}} |
---|
| 133 | \subsubsection[set\_\-parameters]{\setlength{\rightskip}{0pt plus 5cm}void emix::set\_\-parameters (const vec \& {\em w}, \/ const Array$<$ {\bf epdf} $\ast$ $>$ \& {\em Coms}, \/ bool {\em copy} = {\tt true})}} |
---|
| 134 | \label{classemix_d3789d50a3327a6de552db077af5e4c5} |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | Set weights {\tt w} and components {\tt Coms} By default Coms are copied inside. \begin{Desc} |
---|
| 138 | \item[Parameters:] |
---|
| 139 | \begin{description} |
---|
| 140 | \item[{\em copy}]can be set to false if Coms live externally. Use method \hyperlink{classemix_4d7baeb2a9e3fca1d8fd32a107df291d}{ownComs()} if Coms should be destroyed by the destructor. \end{description} |
---|
| 141 | \end{Desc} |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | References epdf::\_\-rv(), Coms, destroyComs, RV::equal(), epdf::rv, and w. |
---|
| 145 | |
---|
| 146 | Referenced by marginal(), MixEF::predictor(), and mmix::set\_\-parameters(). |
---|
| 147 | |
---|
[106] | 148 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
[30] | 149 | \item |
---|
[172] | 150 | work/git/mixpp/bdm/stat/\hyperlink{emix_8h}{emix.h}\item |
---|
[145] | 151 | work/git/mixpp/bdm/stat/emix.cpp\end{CompactItemize} |
---|