\hypertarget{classbdm_1_1mprod}{
\section{bdm::mprod Class Reference}
\label{classbdm_1_1mprod}\index{bdm::mprod@{bdm::mprod}}
}
{\tt \#include $<$emix.h$>$}

Inheritance diagram for bdm::mprod::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classbdm_1_1mprod}
\end{center}
\end{figure}


\subsection{Detailed Description}
Chain rule decomposition of \hyperlink{classbdm_1_1epdf}{epdf}. 

Probability density in the form of Chain-rule decomposition: $\backslash$\mbox{[} f(x\_\-1,x\_\-2,x\_\-3) = f(x\_\-1$|$x\_\-2,x\_\-3)f(x\_\-2,x\_\-3)f(x\_\-3) $\backslash$\mbox{]} Note that \subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1mprod_680c3e2d95b116c7cfb227c7f2984525}{
\hyperlink{classbdm_1_1mprod_680c3e2d95b116c7cfb227c7f2984525}{mprod} (Array$<$ \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ $>$ mFacs)}
\label{classbdm_1_1mprod_680c3e2d95b116c7cfb227c7f2984525}

\begin{CompactList}\small\item\em Constructor from list of mFacs,. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mprod_800f21d94c919137608a2fd5c88719e2}{
double \hyperlink{classbdm_1_1mprod_800f21d94c919137608a2fd5c88719e2}{evallogcond} (const vec \&val, const vec \&cond)}
\label{classbdm_1_1mprod_800f21d94c919137608a2fd5c88719e2}

\begin{CompactList}\small\item\em Shortcut for conditioning and evaluation of the internal \hyperlink{classbdm_1_1epdf}{epdf}. In some cases, this operation can be implemented efficiently. \item\end{CompactList}\item 
vec \hyperlink{classbdm_1_1mprod_ee715a8013acf9892f6cb489db595555}{samplecond} (const vec \&cond)
\begin{CompactList}\small\item\em Returns a sample from the density conditioned on {\tt cond}, $x \sim epdf(rv|cond)$. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mprod_d193dcc89fbc6f21979e0ced6d84568c}{
mat \textbf{samplecond} (const vec \&cond, int N)}
\label{classbdm_1_1mprod_d193dcc89fbc6f21979e0ced6d84568c}

\item 
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1compositepdf_c73d39acc4378eee6a63155c3517d3c9}{getrv} (bool checkoverlap=false)
\begin{CompactList}\small\item\em find common rv, flag \item\end{CompactList}\item 
\hypertarget{classbdm_1_1compositepdf_c71fc2c51f49d797e61f479f543c75ce}{
void \hyperlink{classbdm_1_1compositepdf_c71fc2c51f49d797e61f479f543c75ce}{setrvc} (const \hyperlink{classbdm_1_1RV}{RV} \&rv, \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1mpdf_5a5f08950daa08b85b01ddf4e1c36288}{rvc})}
\label{classbdm_1_1compositepdf_c71fc2c51f49d797e61f479f543c75ce}

\begin{CompactList}\small\item\em common rvc of all mpdfs is written to rvc \item\end{CompactList}\end{CompactItemize}
\begin{Indent}{\bf Matematical operations}\par
\begin{CompactItemize}
\item 
virtual mat \hyperlink{classbdm_1_1mpdf_afe4185b26baeb03688202e254d3b005}{samplecond\_\-m} (const vec \&cond, int N)
\begin{CompactList}\small\item\em Returns. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mpdf_db94784a9aacf74c65c5a014f6743530}{
virtual void \hyperlink{classbdm_1_1mpdf_db94784a9aacf74c65c5a014f6743530}{condition} (const vec \&cond)}
\label{classbdm_1_1mpdf_db94784a9aacf74c65c5a014f6743530}

\begin{CompactList}\small\item\em Update {\tt ep} so that it represents this \hyperlink{classbdm_1_1mpdf}{mpdf} conditioned on {\tt rvc} = cond. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mpdf_0b0ed1ed663071bb7cf4a1349eb94fcb}{
virtual vec \hyperlink{classbdm_1_1mpdf_0b0ed1ed663071bb7cf4a1349eb94fcb}{evallogcond\_\-m} (const mat \&Dt, const vec \&cond)}
\label{classbdm_1_1mpdf_0b0ed1ed663071bb7cf4a1349eb94fcb}

\begin{CompactList}\small\item\em Matrix version of evallogcond. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Access to attributes}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1mpdf_5571482d150fbcb72cc36f6694ce1a10}{
\hyperlink{classbdm_1_1RV}{RV} \textbf{\_\-rv} ()}
\label{classbdm_1_1mpdf_5571482d150fbcb72cc36f6694ce1a10}

\item 
\hypertarget{classbdm_1_1mpdf_26001264236846897bd11e4baad47245}{
\hyperlink{classbdm_1_1RV}{RV} \textbf{\_\-rvc} ()}
\label{classbdm_1_1mpdf_26001264236846897bd11e4baad47245}

\item 
\hypertarget{classbdm_1_1mpdf_1c2bae3e1e90874e72941863974ec0ed}{
int \textbf{dimension} ()}
\label{classbdm_1_1mpdf_1c2bae3e1e90874e72941863974ec0ed}

\item 
\hypertarget{classbdm_1_1mpdf_35e135910aed187b7290742f50e61bc8}{
int \textbf{dimensionc} ()}
\label{classbdm_1_1mpdf_35e135910aed187b7290742f50e61bc8}

\item 
\hypertarget{classbdm_1_1mpdf_1892fe3933488942253679f068e9e7f6}{
\hyperlink{classbdm_1_1epdf}{epdf} \& \textbf{\_\-epdf} ()}
\label{classbdm_1_1mpdf_1892fe3933488942253679f068e9e7f6}

\item 
\hypertarget{classbdm_1_1mpdf_05e843fd11c410a99dad2b88c55aca80}{
\hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \textbf{\_\-e} ()}
\label{classbdm_1_1mpdf_05e843fd11c410a99dad2b88c55aca80}

\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Connection to other objects}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1mpdf_7631a5570e4ade1420065e8df78f4401}{
void \textbf{set\_\-rvc} (const \hyperlink{classbdm_1_1RV}{RV} \&rvc0)}
\label{classbdm_1_1mpdf_7631a5570e4ade1420065e8df78f4401}

\item 
\hypertarget{classbdm_1_1mpdf_18ac26bc2f96ae01ef4eb06178abbd75}{
void \textbf{set\_\-rv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0)}
\label{classbdm_1_1mpdf_18ac26bc2f96ae01ef4eb06178abbd75}

\item 
\hypertarget{classbdm_1_1mpdf_f8e3798150b42fd1f3e16ddbbe0e7045}{
bool \textbf{isnamed} ()}
\label{classbdm_1_1mpdf_f8e3798150b42fd1f3e16ddbbe0e7045}

\end{CompactItemize}
\end{Indent}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1mprod_eca722ed1b219727c6c0f8cbc6bf1e51}{
Array$<$ \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ $>$ \hyperlink{classbdm_1_1mprod_eca722ed1b219727c6c0f8cbc6bf1e51}{epdfs}}
\label{classbdm_1_1mprod_eca722ed1b219727c6c0f8cbc6bf1e51}

\begin{CompactList}\small\item\em pointers to epdfs - shortcut to \hyperlink{classbdm_1_1compositepdf_23faf2debc4dde10836393b8c665914a}{mpdfs()}.posterior() \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mprod_acf679b3b1d48629c5a042d9ac0d973f}{
Array$<$ \hyperlink{classbdm_1_1datalink__m2m}{datalink\_\-m2m} $\ast$ $>$ \hyperlink{classbdm_1_1mprod_acf679b3b1d48629c5a042d9ac0d973f}{dls}}
\label{classbdm_1_1mprod_acf679b3b1d48629c5a042d9ac0d973f}

\begin{CompactList}\small\item\em Data link for each mpdfs. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mprod_e3fe66c257e5eca9de1031ef44907677}{
\hyperlink{classbdm_1_1epdf}{epdf} \hyperlink{classbdm_1_1mprod_e3fe66c257e5eca9de1031ef44907677}{dummy}}
\label{classbdm_1_1mprod_e3fe66c257e5eca9de1031ef44907677}

\begin{CompactList}\small\item\em dummy ep \item\end{CompactList}\item 
\hypertarget{classbdm_1_1compositepdf_7ca3cd8ed92a7154f5b9ff13b1e9d52a}{
int \hyperlink{classbdm_1_1compositepdf_7ca3cd8ed92a7154f5b9ff13b1e9d52a}{n}}
\label{classbdm_1_1compositepdf_7ca3cd8ed92a7154f5b9ff13b1e9d52a}

\begin{CompactList}\small\item\em Number of mpdfs in the composite. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1compositepdf_23faf2debc4dde10836393b8c665914a}{
Array$<$ \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ $>$ \hyperlink{classbdm_1_1compositepdf_23faf2debc4dde10836393b8c665914a}{mpdfs}}
\label{classbdm_1_1compositepdf_23faf2debc4dde10836393b8c665914a}

\begin{CompactList}\small\item\em Elements of composition. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mpdf_7c1900976ff13dbc09c9729b3bbff9e6}{
int \hyperlink{classbdm_1_1mpdf_7c1900976ff13dbc09c9729b3bbff9e6}{dimc}}
\label{classbdm_1_1mpdf_7c1900976ff13dbc09c9729b3bbff9e6}

\begin{CompactList}\small\item\em dimension of the condition \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mpdf_5a5f08950daa08b85b01ddf4e1c36288}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1mpdf_5a5f08950daa08b85b01ddf4e1c36288}{rvc}}
\label{classbdm_1_1mpdf_5a5f08950daa08b85b01ddf4e1c36288}

\begin{CompactList}\small\item\em random variable in condition \item\end{CompactList}\item 
\hypertarget{classbdm_1_1mpdf_5eea43c56d38e4441bfb30270db949c0}{
\hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1mpdf_5eea43c56d38e4441bfb30270db949c0}{ep}}
\label{classbdm_1_1mpdf_5eea43c56d38e4441bfb30270db949c0}

\begin{CompactList}\small\item\em pointer to internal \hyperlink{classbdm_1_1epdf}{epdf} \item\end{CompactList}\end{CompactItemize}


\subsection{Member Function Documentation}
\hypertarget{classbdm_1_1mprod_ee715a8013acf9892f6cb489db595555}{
\index{bdm::mprod@{bdm::mprod}!samplecond@{samplecond}}
\index{samplecond@{samplecond}!bdm::mprod@{bdm::mprod}}
\subsubsection[samplecond]{\setlength{\rightskip}{0pt plus 5cm}vec bdm::mprod::samplecond (const vec \& {\em cond})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}
\label{classbdm_1_1mprod_ee715a8013acf9892f6cb489db595555}


Returns a sample from the density conditioned on {\tt cond}, $x \sim epdf(rv|cond)$. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cond}]is numeric value of {\tt rv} \end{description}
\end{Desc}


Reimplemented from \hyperlink{classbdm_1_1mpdf_f0c1db6fcbb3aae2dd6123884457a367}{bdm::mpdf}.

References bdm::epdf::dimension(), dls, bdm::mpdf::ep, epdfs, bdm::compositepdf::mpdfs, and bdm::compositepdf::n.\hypertarget{classbdm_1_1compositepdf_c73d39acc4378eee6a63155c3517d3c9}{
\index{bdm::mprod@{bdm::mprod}!getrv@{getrv}}
\index{getrv@{getrv}!bdm::mprod@{bdm::mprod}}
\subsubsection[getrv]{\setlength{\rightskip}{0pt plus 5cm}{\bf RV} bdm::compositepdf::getrv (bool {\em checkoverlap} = {\tt false})\hspace{0.3cm}{\tt  \mbox{[}inherited\mbox{]}}}}
\label{classbdm_1_1compositepdf_c73d39acc4378eee6a63155c3517d3c9}


find common rv, flag 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em checkoverlap}]modifies whether overlaps are acceptable \end{description}
\end{Desc}


References bdm::RV::add(), bdm::compositepdf::mpdfs, and bdm::compositepdf::n.

Referenced by mprod().\hypertarget{classbdm_1_1mpdf_afe4185b26baeb03688202e254d3b005}{
\index{bdm::mprod@{bdm::mprod}!samplecond\_\-m@{samplecond\_\-m}}
\index{samplecond\_\-m@{samplecond\_\-m}!bdm::mprod@{bdm::mprod}}
\subsubsection[samplecond\_\-m]{\setlength{\rightskip}{0pt plus 5cm}virtual mat bdm::mpdf::samplecond\_\-m (const vec \& {\em cond}, \/  int {\em N})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual, inherited\mbox{]}}}}
\label{classbdm_1_1mpdf_afe4185b26baeb03688202e254d3b005}


Returns. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em N}]samples from the density conditioned on {\tt cond}, $x \sim epdf(rv|cond)$. \item[{\em cond}]is numeric value of {\tt rv} \item[{\em ll}]is a return value of log-likelihood of the sample. \end{description}
\end{Desc}


References bdm::mpdf::condition(), bdm::epdf::dimension(), bdm::mpdf::ep, and bdm::epdf::sample().

The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
\hyperlink{emix_8h}{emix.h}\end{CompactItemize}
