\hypertarget{classbdm_1_1eEmp}{
\section{bdm::eEmp Class Reference}
\label{classbdm_1_1eEmp}\index{bdm::eEmp@{bdm::eEmp}}
}
{\tt \#include $<$libEF.h$>$}

Inheritance diagram for bdm::eEmp:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=64pt]{classbdm_1_1eEmp__inherit__graph}
\end{center}
\end{figure}


\subsection{Detailed Description}
Weighted empirical density. 

Used e.g. in particle filters. \subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1eEmp_34d7f929fbab6c1e4ce318c56a6399c7}{
\hyperlink{classbdm_1_1eEmp_34d7f929fbab6c1e4ce318c56a6399c7}{eEmp} (int n0)}
\label{classbdm_1_1eEmp_34d7f929fbab6c1e4ce318c56a6399c7}

\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_82320074a9b0ad7e1bb33a6e885b65d7}{
void \hyperlink{classbdm_1_1eEmp_82320074a9b0ad7e1bb33a6e885b65d7}{set\_\-parameters} (const vec \&w0, const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$pdf0)}
\label{classbdm_1_1eEmp_82320074a9b0ad7e1bb33a6e885b65d7}

\begin{CompactList}\small\item\em Set samples and weights. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_b62d802b8ef39f7c4dcbeb366c90951a}{
void \hyperlink{classbdm_1_1eEmp_b62d802b8ef39f7c4dcbeb366c90951a}{set\_\-samples} (const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$pdf0)}
\label{classbdm_1_1eEmp_b62d802b8ef39f7c4dcbeb366c90951a}

\begin{CompactList}\small\item\em Set sample. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_dccd02eaa4c45e858a6351723686ac85}{
void \hyperlink{classbdm_1_1eEmp_dccd02eaa4c45e858a6351723686ac85}{set\_\-n} (int n0, bool copy=true)}
\label{classbdm_1_1eEmp_dccd02eaa4c45e858a6351723686ac85}

\begin{CompactList}\small\item\em Set sample. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_d7f83cc0415cd44ae7cc8b4bdad93aef}{
vec \& \hyperlink{classbdm_1_1eEmp_d7f83cc0415cd44ae7cc8b4bdad93aef}{\_\-w} ()}
\label{classbdm_1_1eEmp_d7f83cc0415cd44ae7cc8b4bdad93aef}

\begin{CompactList}\small\item\em Potentially dangerous, use with care. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_b7d7106f486e3fad38590914a693d714}{
const vec \& \hyperlink{classbdm_1_1eEmp_b7d7106f486e3fad38590914a693d714}{\_\-w} () const }
\label{classbdm_1_1eEmp_b7d7106f486e3fad38590914a693d714}

\begin{CompactList}\small\item\em Potentially dangerous, use with care. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_c24966b0aaeb767bc8a6b4fd60931be2}{
Array$<$ vec $>$ \& \hyperlink{classbdm_1_1eEmp_c24966b0aaeb767bc8a6b4fd60931be2}{\_\-samples} ()}
\label{classbdm_1_1eEmp_c24966b0aaeb767bc8a6b4fd60931be2}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_b59af0efdb009d98ea8ebfa965e74ae2}{
const Array$<$ vec $>$ \& \hyperlink{classbdm_1_1eEmp_b59af0efdb009d98ea8ebfa965e74ae2}{\_\-samples} () const }
\label{classbdm_1_1eEmp_b59af0efdb009d98ea8ebfa965e74ae2}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_f06ce255de5dbb2313f52ee51f82ba3d}{
ivec \hyperlink{classbdm_1_1eEmp_f06ce255de5dbb2313f52ee51f82ba3d}{resample} (\hyperlink{namespacebdm_33aac0be76ded31d2e3081c5a3f6c418}{RESAMPLING\_\-METHOD} method=SYSTEMATIC)}
\label{classbdm_1_1eEmp_f06ce255de5dbb2313f52ee51f82ba3d}

\begin{CompactList}\small\item\em Function performs resampling, i.e. removal of low-weight samples and duplication of high-weight samples such that the new samples represent the same density. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_97f1e07b5ae6eebc91c7365f0f88d270}{
vec \hyperlink{classbdm_1_1eEmp_97f1e07b5ae6eebc91c7365f0f88d270}{sample} () const }
\label{classbdm_1_1eEmp_97f1e07b5ae6eebc91c7365f0f88d270}

\begin{CompactList}\small\item\em inherited operation : NOT implemneted \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_01654c014d3aa068f8d4ecba4be86d09}{
double \hyperlink{classbdm_1_1eEmp_01654c014d3aa068f8d4ecba4be86d09}{evallog} (const vec \&val) const }
\label{classbdm_1_1eEmp_01654c014d3aa068f8d4ecba4be86d09}

\begin{CompactList}\small\item\em inherited operation : NOT implemneted \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_bbfcb4f868c7381298c281a256d8c4b9}{
vec \hyperlink{classbdm_1_1eEmp_bbfcb4f868c7381298c281a256d8c4b9}{mean} () const }
\label{classbdm_1_1eEmp_bbfcb4f868c7381298c281a256d8c4b9}

\begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_05e9ebf467ede737cb6a3621d7fd3c87}{
vec \hyperlink{classbdm_1_1eEmp_05e9ebf467ede737cb6a3621d7fd3c87}{variance} () const }
\label{classbdm_1_1eEmp_05e9ebf467ede737cb6a3621d7fd3c87}

\begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\end{CompactItemize}
\begin{Indent}{\bf Matematical Operations}\par
\begin{CompactItemize}
\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, $ [x_1 , x_2 , \ldots \ $ from density $ f_x(rv)$. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{
virtual vec \hyperlink{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{evallog\_\-m} (const mat \&Val) const }
\label{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}

\begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_e584eac5579c1b6384947ecf66166c77}{
virtual \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ \hyperlink{classbdm_1_1epdf_e584eac5579c1b6384947ecf66166c77}{condition} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}) const }
\label{classbdm_1_1epdf_e584eac5579c1b6384947ecf66166c77}

\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_1epdf_3fb2ece54f720b62ad325e61214fa0a1}{
virtual \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}{marginal} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}) const }
\label{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}

\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}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Connection to other classes}\par
{\em Description of the random quantity via attribute {\tt rv} is optional. For operations such as sampling {\tt rv} does not need to be set. However, for {\tt marginalization} and {\tt conditioning} {\tt rv} has to be set. NB: }\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{
void \hyperlink{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{set\_\-rv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0)}
\label{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}

\begin{CompactList}\small\item\em Name its rv. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{
bool \hyperlink{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{isnamed} () const }
\label{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}

\begin{CompactList}\small\item\em True if rv is assigned. \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 Return name (fails when isnamed is false). \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Access to attributes}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}{
bool \hyperlink{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}{dimension} () const }
\label{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}

\begin{CompactList}\small\item\em Size of the random variable. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1eEmp_9798006271ca77629855113f1283a031}{
int \hyperlink{classbdm_1_1eEmp_9798006271ca77629855113f1283a031}{n}}
\label{classbdm_1_1eEmp_9798006271ca77629855113f1283a031}

\begin{CompactList}\small\item\em Number of particles. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_9d39241aab7c4bbeb07c6d516421c67d}{
vec \hyperlink{classbdm_1_1eEmp_9d39241aab7c4bbeb07c6d516421c67d}{w}}
\label{classbdm_1_1eEmp_9d39241aab7c4bbeb07c6d516421c67d}

\begin{CompactList}\small\item\em Sample weights $w$. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eEmp_73d819553a0f268b055a087d2d4486f3}{
Array$<$ vec $>$ \hyperlink{classbdm_1_1eEmp_73d819553a0f268b055a087d2d4486f3}{samples}}
\label{classbdm_1_1eEmp_73d819553a0f268b055a087d2d4486f3}

\begin{CompactList}\small\item\em Samples $x^{(i)}, i=1..n$. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}{
int \hyperlink{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}{dim}}
\label{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}

\begin{CompactList}\small\item\em dimension of the random variable \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 Description of the random variable. \item\end{CompactList}\end{CompactItemize}


The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
\hyperlink{libEF_8h}{libEF.h}\item 
libEF.cpp\end{CompactItemize}
