\section{emix Class Reference}
\label{classemix}\index{emix@{emix}}
Mixture of epdfs.  


{\tt \#include $<$emix.h$>$}

Inheritance diagram for emix:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=40pt]{classemix__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for emix:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=40pt]{classemix__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf emix} ({\bf RV} \&{\bf rv})\label{classemix_3a10c8481115a5460877272ddb6532a6}

\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
void {\bf set\_\-parameters} (const vec \&{\bf w}, const Array$<$ {\bf epdf} $\ast$ $>$ \&{\bf Coms})\label{classemix_6ce82b24d7fe540ddbf44b472a005555}

\begin{CompactList}\small\item\em Set weights {\tt w} and components {\tt R}. \item\end{CompactList}\item 
vec {\bf sample} () const 
\begin{CompactList}\small\item\em Returns the required moment of the \doxyref{epdf}{p.}{classepdf}. \item\end{CompactList}\item 
vec {\bf mean} () const \label{classemix_b662a51d042b062020460e64bff4e9e8}

\begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item 
double {\bf evalpdflog} (const vec \&val) const \label{classemix_469e910479b3402589104ef3bb1b5741}

\begin{CompactList}\small\item\em Compute log-probability of argument {\tt val}. \item\end{CompactList}\item 
vec \& {\bf \_\-w} ()\label{classemix_35baf0f62307455cebfbf462144b4dd8}

\begin{CompactList}\small\item\em returns a pointer to the internal mean value. Use with Care! \item\end{CompactList}\item 
virtual mat {\bf sampleN} (int N) const \label{classepdf_54d7dd53a641b618771cd9bee135181f}

\begin{CompactList}\small\item\em Returns N samples from density $epdf(rv)$. \item\end{CompactList}\item 
virtual double {\bf eval} (const vec \&val) const \label{classepdf_3ea597362e11a0040fe7c990269d072c}

\begin{CompactList}\small\item\em Compute probability of argument {\tt val}. \item\end{CompactList}\item 
{\bf RV} \& {\bf \_\-rv} ()\label{classepdf_4778ea61ef400813e47750e024e9fc2f}

\begin{CompactList}\small\item\em access function, possibly dangerous! \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
vec {\bf w}\label{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab}

\begin{CompactList}\small\item\em weights of the components \item\end{CompactList}\item 
Array$<$ {\bf epdf} $\ast$ $>$ {\bf Coms}\label{classemix_7155d827417b53fb6aa5cff1459e6eb4}

\begin{CompactList}\small\item\em Component (epdfs). \item\end{CompactList}\item 
{\bf RV} {\bf rv}\label{classepdf_74da992e3f5d598da8850b646b79b9d9}

\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}
\index{emix@{emix}!sample@{sample}}
\index{sample@{sample}!emix@{emix}}
\subsubsection[sample]{\setlength{\rightskip}{0pt plus 5cm}vec emix::sample () const\hspace{0.3cm}{\tt  [virtual]}}\label{classemix_0650601f24e633e0ab09aa1e46c14483}


Returns the required moment of the \doxyref{epdf}{p.}{classepdf}. 

Returns a sample, $x$ from density $epdf(rv)$ 

Implements {\bf epdf} \doxyref{}{p.}{classepdf_8019654e494bf5e458f6fb947e11b262}.

References Coms, and w.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
work/git/mixpp/bdm/stat/{\bf emix.h}\item 
work/git/mixpp/bdm/stat/emix.cpp\end{CompactItemize}
