\hypertarget{classbdm_1_1emix}{ \section{bdm::emix Class Reference} \label{classbdm_1_1emix}\index{bdm::emix@{bdm::emix}} } Mixture of epdfs. {\tt \#include $<$emix.h$>$} Inheritance diagram for bdm::emix:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=64pt]{classbdm_1_1emix__inherit__graph} \end{center} \end{figure} Collaboration diagram for bdm::emix:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=75pt]{classbdm_1_1emix__coll__graph} \end{center} \end{figure} \subsection*{Public Member Functions} \begin{CompactItemize} \item \hypertarget{classbdm_1_1emix_38649cee71ed9d8c32cfe8bb4b78a98b}{ \hyperlink{classbdm_1_1emix_38649cee71ed9d8c32cfe8bb4b78a98b}{emix} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv})} \label{classbdm_1_1emix_38649cee71ed9d8c32cfe8bb4b78a98b} \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 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) \item \hypertarget{classbdm_1_1emix_e8839dbbb0d1276a8dbe957a67cfe0dc}{ vec \hyperlink{classbdm_1_1emix_e8839dbbb0d1276a8dbe957a67cfe0dc}{sample} () const } \label{classbdm_1_1emix_e8839dbbb0d1276a8dbe957a67cfe0dc} \begin{CompactList}\small\item\em Returns a sample, $x$ from density $epdf(rv)$. \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_a3a5390bc56e81ef3b0debc0f185fa8a}{ vec \hyperlink{classbdm_1_1emix_a3a5390bc56e81ef3b0debc0f185fa8a}{mean} () const } \label{classbdm_1_1emix_a3a5390bc56e81ef3b0debc0f185fa8a} \begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_e9a627023cdf90c9ffd8eef726595c86}{ vec \hyperlink{classbdm_1_1emix_e9a627023cdf90c9ffd8eef726595c86}{variance} () const } \label{classbdm_1_1emix_e9a627023cdf90c9ffd8eef726595c86} \begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_0f3db99f730bde6b7953931594537e8e}{ double \hyperlink{classbdm_1_1emix_0f3db99f730bde6b7953931594537e8e}{evallog} (const vec \&val) const } \label{classbdm_1_1emix_0f3db99f730bde6b7953931594537e8e} \begin{CompactList}\small\item\em Compute log-probability of argument {\tt val}. \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_23af1986e2afcbc8c7e1c30f610e703b}{ vec \hyperlink{classbdm_1_1emix_23af1986e2afcbc8c7e1c30f610e703b}{evallog\_\-m} (const mat \&Val) const } \label{classbdm_1_1emix_23af1986e2afcbc8c7e1c30f610e703b} \begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_e64c1d5a73f541e469792e23d4677af2}{ mat \hyperlink{classbdm_1_1emix_e64c1d5a73f541e469792e23d4677af2}{evallog\_\-M} (const mat \&Val) const } \label{classbdm_1_1emix_e64c1d5a73f541e469792e23d4677af2} \begin{CompactList}\small\item\em Auxiliary function that returns pdflog for each component. \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_f7165371cc4f7be9292024b9f5431646}{ \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 } \label{classbdm_1_1emix_f7165371cc4f7be9292024b9f5431646} \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 \hypertarget{classbdm_1_1emix_fc7772a2972959cf19ba26882feacecf}{ \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 } \label{classbdm_1_1emix_fc7772a2972959cf19ba26882feacecf} \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 \hypertarget{classbdm_1_1emix_d9b584cb5b2471a4250fb127757f28be}{ vec \& \hyperlink{classbdm_1_1emix_d9b584cb5b2471a4250fb127757f28be}{\_\-w} ()} \label{classbdm_1_1emix_d9b584cb5b2471a4250fb127757f28be} \begin{CompactList}\small\item\em returns a pointer to the internal mean value. Use with Care! \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_965fb16669250a3d28bc62cf76276d8e}{ void \hyperlink{classbdm_1_1emix_965fb16669250a3d28bc62cf76276d8e}{ownComs} ()} \label{classbdm_1_1emix_965fb16669250a3d28bc62cf76276d8e} \begin{CompactList}\small\item\em Auxiliary function for taking ownership of the \hyperlink{classbdm_1_1emix_e2966a6a44b250e22e55bc9fb6af5c3e}{Coms()}. \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_578616445243674438257be99ba71612}{ \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1emix_578616445243674438257be99ba71612}{\_\-Coms} (int i)} \label{classbdm_1_1emix_578616445243674438257be99ba71612} \begin{CompactList}\small\item\em access function \item\end{CompactList}\item \hypertarget{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{ virtual mat \hyperlink{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{sample\_\-m} (int N) const } \label{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058} \begin{CompactList}\small\item\em Returns N samples from density $epdf(rv)$. \item\end{CompactList}\item \hypertarget{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{ const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{\_\-rv} () const } \label{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21} \begin{CompactList}\small\item\em access function, possibly dangerous! \item\end{CompactList}\item \hypertarget{classbdm_1_1epdf_62e88cbce0ce77a8692f5e15d76e805f}{ void \hyperlink{classbdm_1_1epdf_62e88cbce0ce77a8692f5e15d76e805f}{\_\-renewrv} (const \hyperlink{classbdm_1_1RV}{RV} \&in\_\-rv)} \label{classbdm_1_1epdf_62e88cbce0ce77a8692f5e15d76e805f} \begin{CompactList}\small\item\em modifier function - useful when copying epdfs \item\end{CompactList}\end{CompactItemize} \subsection*{Protected Attributes} \begin{CompactItemize} \item \hypertarget{classbdm_1_1emix_bb7270345c76da627cd77ddf020bcf46}{ vec \hyperlink{classbdm_1_1emix_bb7270345c76da627cd77ddf020bcf46}{w}} \label{classbdm_1_1emix_bb7270345c76da627cd77ddf020bcf46} \begin{CompactList}\small\item\em weights of the components \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_e2966a6a44b250e22e55bc9fb6af5c3e}{ Array$<$ \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ $>$ \hyperlink{classbdm_1_1emix_e2966a6a44b250e22e55bc9fb6af5c3e}{Coms}} \label{classbdm_1_1emix_e2966a6a44b250e22e55bc9fb6af5c3e} \begin{CompactList}\small\item\em Component (epdfs). \item\end{CompactList}\item \hypertarget{classbdm_1_1emix_47189df41a4616c2fed5972f015743f4}{ bool \hyperlink{classbdm_1_1emix_47189df41a4616c2fed5972f015743f4}{destroyComs}} \label{classbdm_1_1emix_47189df41a4616c2fed5972f015743f4} \begin{CompactList}\small\item\em Flag if owning Coms. \item\end{CompactList}\item \hypertarget{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{ \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}} \label{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8} \begin{CompactList}\small\item\em Identified of the random variable. \item\end{CompactList}\end{CompactItemize} \subsection{Detailed Description} Mixture of epdfs. 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\/}, \subsection{Member Function Documentation} \hypertarget{classbdm_1_1emix_d8c1aefba8302759836b5f26999ce840}{ \index{bdm::emix@{bdm::emix}!set\_\-parameters@{set\_\-parameters}} \index{set\_\-parameters@{set\_\-parameters}!bdm::emix@{bdm::emix}} \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})}} \label{classbdm_1_1emix_d8c1aefba8302759836b5f26999ce840} 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. References bdm::epdf::\_\-rv(), Coms, destroyComs, bdm::RV::equal(), bdm::epdf::rv, and w. Referenced by marginal(), bdm::MixEF::predictor(), and bdm::mmix::set\_\-parameters(). The documentation for this class was generated from the following files:\begin{CompactItemize} \item \hyperlink{emix_8h}{emix.h}\item emix.cpp\end{CompactItemize}