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