[261] | 1 | \hypertarget{classbdm_1_1eEmp}{ |
---|
| 2 | \section{bdm::eEmp Class Reference} |
---|
| 3 | \label{classbdm_1_1eEmp}\index{bdm::eEmp@{bdm::eEmp}} |
---|
| 4 | } |
---|
| 5 | {\tt \#include $<$libEF.h$>$} |
---|
| 6 | |
---|
| 7 | Inheritance diagram for bdm::eEmp:\nopagebreak |
---|
| 8 | \begin{figure}[H] |
---|
| 9 | \begin{center} |
---|
| 10 | \leavevmode |
---|
| 11 | \includegraphics[width=64pt]{classbdm_1_1eEmp__inherit__graph} |
---|
| 12 | \end{center} |
---|
| 13 | \end{figure} |
---|
[270] | 14 | |
---|
| 15 | |
---|
| 16 | \subsection{Detailed Description} |
---|
| 17 | Weighted empirical density. |
---|
| 18 | |
---|
| 19 | Used e.g. in particle filters. \subsection*{Public Member Functions} |
---|
[261] | 20 | \begin{CompactItemize} |
---|
| 21 | \item |
---|
[270] | 22 | \hypertarget{classbdm_1_1eEmp_34d7f929fbab6c1e4ce318c56a6399c7}{ |
---|
| 23 | \hyperlink{classbdm_1_1eEmp_34d7f929fbab6c1e4ce318c56a6399c7}{eEmp} (int n0)} |
---|
| 24 | \label{classbdm_1_1eEmp_34d7f929fbab6c1e4ce318c56a6399c7} |
---|
[261] | 25 | |
---|
| 26 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
| 27 | \hypertarget{classbdm_1_1eEmp_82320074a9b0ad7e1bb33a6e885b65d7}{ |
---|
| 28 | void \hyperlink{classbdm_1_1eEmp_82320074a9b0ad7e1bb33a6e885b65d7}{set\_\-parameters} (const vec \&w0, const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$pdf0)} |
---|
| 29 | \label{classbdm_1_1eEmp_82320074a9b0ad7e1bb33a6e885b65d7} |
---|
| 30 | |
---|
| 31 | \begin{CompactList}\small\item\em Set samples and weights. \item\end{CompactList}\item |
---|
| 32 | \hypertarget{classbdm_1_1eEmp_b62d802b8ef39f7c4dcbeb366c90951a}{ |
---|
| 33 | void \hyperlink{classbdm_1_1eEmp_b62d802b8ef39f7c4dcbeb366c90951a}{set\_\-samples} (const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$pdf0)} |
---|
| 34 | \label{classbdm_1_1eEmp_b62d802b8ef39f7c4dcbeb366c90951a} |
---|
| 35 | |
---|
| 36 | \begin{CompactList}\small\item\em Set sample. \item\end{CompactList}\item |
---|
| 37 | \hypertarget{classbdm_1_1eEmp_dccd02eaa4c45e858a6351723686ac85}{ |
---|
| 38 | void \hyperlink{classbdm_1_1eEmp_dccd02eaa4c45e858a6351723686ac85}{set\_\-n} (int n0, bool copy=true)} |
---|
| 39 | \label{classbdm_1_1eEmp_dccd02eaa4c45e858a6351723686ac85} |
---|
| 40 | |
---|
| 41 | \begin{CompactList}\small\item\em Set sample. \item\end{CompactList}\item |
---|
| 42 | \hypertarget{classbdm_1_1eEmp_d7f83cc0415cd44ae7cc8b4bdad93aef}{ |
---|
| 43 | vec \& \hyperlink{classbdm_1_1eEmp_d7f83cc0415cd44ae7cc8b4bdad93aef}{\_\-w} ()} |
---|
| 44 | \label{classbdm_1_1eEmp_d7f83cc0415cd44ae7cc8b4bdad93aef} |
---|
| 45 | |
---|
| 46 | \begin{CompactList}\small\item\em Potentially dangerous, use with care. \item\end{CompactList}\item |
---|
| 47 | \hypertarget{classbdm_1_1eEmp_b7d7106f486e3fad38590914a693d714}{ |
---|
| 48 | const vec \& \hyperlink{classbdm_1_1eEmp_b7d7106f486e3fad38590914a693d714}{\_\-w} () const } |
---|
| 49 | \label{classbdm_1_1eEmp_b7d7106f486e3fad38590914a693d714} |
---|
| 50 | |
---|
| 51 | \begin{CompactList}\small\item\em Potentially dangerous, use with care. \item\end{CompactList}\item |
---|
| 52 | \hypertarget{classbdm_1_1eEmp_c24966b0aaeb767bc8a6b4fd60931be2}{ |
---|
| 53 | Array$<$ vec $>$ \& \hyperlink{classbdm_1_1eEmp_c24966b0aaeb767bc8a6b4fd60931be2}{\_\-samples} ()} |
---|
| 54 | \label{classbdm_1_1eEmp_c24966b0aaeb767bc8a6b4fd60931be2} |
---|
| 55 | |
---|
| 56 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
| 57 | \hypertarget{classbdm_1_1eEmp_b59af0efdb009d98ea8ebfa965e74ae2}{ |
---|
| 58 | const Array$<$ vec $>$ \& \hyperlink{classbdm_1_1eEmp_b59af0efdb009d98ea8ebfa965e74ae2}{\_\-samples} () const } |
---|
| 59 | \label{classbdm_1_1eEmp_b59af0efdb009d98ea8ebfa965e74ae2} |
---|
| 60 | |
---|
| 61 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
| 62 | \hypertarget{classbdm_1_1eEmp_f06ce255de5dbb2313f52ee51f82ba3d}{ |
---|
| 63 | ivec \hyperlink{classbdm_1_1eEmp_f06ce255de5dbb2313f52ee51f82ba3d}{resample} (\hyperlink{namespacebdm_33aac0be76ded31d2e3081c5a3f6c418}{RESAMPLING\_\-METHOD} method=SYSTEMATIC)} |
---|
| 64 | \label{classbdm_1_1eEmp_f06ce255de5dbb2313f52ee51f82ba3d} |
---|
| 65 | |
---|
| 66 | \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 |
---|
| 67 | \hypertarget{classbdm_1_1eEmp_97f1e07b5ae6eebc91c7365f0f88d270}{ |
---|
| 68 | vec \hyperlink{classbdm_1_1eEmp_97f1e07b5ae6eebc91c7365f0f88d270}{sample} () const } |
---|
| 69 | \label{classbdm_1_1eEmp_97f1e07b5ae6eebc91c7365f0f88d270} |
---|
| 70 | |
---|
| 71 | \begin{CompactList}\small\item\em inherited operation : NOT implemneted \item\end{CompactList}\item |
---|
| 72 | \hypertarget{classbdm_1_1eEmp_01654c014d3aa068f8d4ecba4be86d09}{ |
---|
| 73 | double \hyperlink{classbdm_1_1eEmp_01654c014d3aa068f8d4ecba4be86d09}{evallog} (const vec \&val) const } |
---|
| 74 | \label{classbdm_1_1eEmp_01654c014d3aa068f8d4ecba4be86d09} |
---|
| 75 | |
---|
| 76 | \begin{CompactList}\small\item\em inherited operation : NOT implemneted \item\end{CompactList}\item |
---|
| 77 | \hypertarget{classbdm_1_1eEmp_bbfcb4f868c7381298c281a256d8c4b9}{ |
---|
| 78 | vec \hyperlink{classbdm_1_1eEmp_bbfcb4f868c7381298c281a256d8c4b9}{mean} () const } |
---|
| 79 | \label{classbdm_1_1eEmp_bbfcb4f868c7381298c281a256d8c4b9} |
---|
| 80 | |
---|
| 81 | \begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item |
---|
| 82 | \hypertarget{classbdm_1_1eEmp_05e9ebf467ede737cb6a3621d7fd3c87}{ |
---|
| 83 | vec \hyperlink{classbdm_1_1eEmp_05e9ebf467ede737cb6a3621d7fd3c87}{variance} () const } |
---|
| 84 | \label{classbdm_1_1eEmp_05e9ebf467ede737cb6a3621d7fd3c87} |
---|
| 85 | |
---|
[270] | 86 | \begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\end{CompactItemize} |
---|
| 87 | \begin{Indent}{\bf Matematical Operations}\par |
---|
| 88 | \begin{CompactItemize} |
---|
| 89 | \item |
---|
[261] | 90 | \hypertarget{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{ |
---|
| 91 | virtual mat \hyperlink{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{sample\_\-m} (int N) const } |
---|
| 92 | \label{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058} |
---|
| 93 | |
---|
[270] | 94 | \begin{CompactList}\small\item\em Returns N samples, $ [x_1 , x_2 , \ldots \ $ from density $ f_x(rv)$. \item\end{CompactList}\item |
---|
[261] | 95 | \hypertarget{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{ |
---|
| 96 | virtual vec \hyperlink{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{evallog\_\-m} (const mat \&Val) const } |
---|
| 97 | \label{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62} |
---|
| 98 | |
---|
| 99 | \begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item |
---|
| 100 | \hypertarget{classbdm_1_1epdf_e584eac5579c1b6384947ecf66166c77}{ |
---|
| 101 | 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 } |
---|
| 102 | \label{classbdm_1_1epdf_e584eac5579c1b6384947ecf66166c77} |
---|
| 103 | |
---|
| 104 | \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 |
---|
| 105 | \hypertarget{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}{ |
---|
| 106 | 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 } |
---|
| 107 | \label{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1} |
---|
| 108 | |
---|
[270] | 109 | \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} |
---|
| 110 | \end{Indent} |
---|
| 111 | \begin{Indent}{\bf Connection to other classes}\par |
---|
| 112 | {\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} |
---|
| 113 | \item |
---|
| 114 | \hypertarget{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{ |
---|
| 115 | void \hyperlink{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{set\_\-rv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0)} |
---|
| 116 | \label{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff} |
---|
| 117 | |
---|
| 118 | \begin{CompactList}\small\item\em Name its rv. \item\end{CompactList}\item |
---|
| 119 | \hypertarget{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{ |
---|
| 120 | bool \hyperlink{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{isnamed} () const } |
---|
| 121 | \label{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9} |
---|
| 122 | |
---|
| 123 | \begin{CompactList}\small\item\em True if rv is assigned. \item\end{CompactList}\item |
---|
[261] | 124 | \hypertarget{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{ |
---|
| 125 | const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{\_\-rv} () const } |
---|
| 126 | \label{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21} |
---|
| 127 | |
---|
[270] | 128 | \begin{CompactList}\small\item\em Return name (fails when isnamed is false). \item\end{CompactList}\end{CompactItemize} |
---|
| 129 | \end{Indent} |
---|
| 130 | \begin{Indent}{\bf Access to attributes}\par |
---|
| 131 | \begin{CompactItemize} |
---|
| 132 | \item |
---|
| 133 | \hypertarget{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}{ |
---|
| 134 | bool \hyperlink{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}{dimension} () const } |
---|
| 135 | \label{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b} |
---|
[261] | 136 | |
---|
[270] | 137 | \begin{CompactList}\small\item\em Size of the random variable. \item\end{CompactList}\end{CompactItemize} |
---|
| 138 | \end{Indent} |
---|
[261] | 139 | \subsection*{Protected Attributes} |
---|
| 140 | \begin{CompactItemize} |
---|
| 141 | \item |
---|
| 142 | \hypertarget{classbdm_1_1eEmp_9798006271ca77629855113f1283a031}{ |
---|
| 143 | int \hyperlink{classbdm_1_1eEmp_9798006271ca77629855113f1283a031}{n}} |
---|
| 144 | \label{classbdm_1_1eEmp_9798006271ca77629855113f1283a031} |
---|
| 145 | |
---|
| 146 | \begin{CompactList}\small\item\em Number of particles. \item\end{CompactList}\item |
---|
| 147 | \hypertarget{classbdm_1_1eEmp_9d39241aab7c4bbeb07c6d516421c67d}{ |
---|
| 148 | vec \hyperlink{classbdm_1_1eEmp_9d39241aab7c4bbeb07c6d516421c67d}{w}} |
---|
| 149 | \label{classbdm_1_1eEmp_9d39241aab7c4bbeb07c6d516421c67d} |
---|
| 150 | |
---|
| 151 | \begin{CompactList}\small\item\em Sample weights $w$. \item\end{CompactList}\item |
---|
| 152 | \hypertarget{classbdm_1_1eEmp_73d819553a0f268b055a087d2d4486f3}{ |
---|
| 153 | Array$<$ vec $>$ \hyperlink{classbdm_1_1eEmp_73d819553a0f268b055a087d2d4486f3}{samples}} |
---|
| 154 | \label{classbdm_1_1eEmp_73d819553a0f268b055a087d2d4486f3} |
---|
| 155 | |
---|
| 156 | \begin{CompactList}\small\item\em Samples $x^{(i)}, i=1..n$. \item\end{CompactList}\item |
---|
[270] | 157 | \hypertarget{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}{ |
---|
| 158 | int \hyperlink{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}{dim}} |
---|
| 159 | \label{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce} |
---|
| 160 | |
---|
| 161 | \begin{CompactList}\small\item\em dimension of the random variable \item\end{CompactList}\item |
---|
[261] | 162 | \hypertarget{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{ |
---|
| 163 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}} |
---|
| 164 | \label{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8} |
---|
| 165 | |
---|
[270] | 166 | \begin{CompactList}\small\item\em Description of the random variable. \item\end{CompactList}\end{CompactItemize} |
---|
[261] | 167 | |
---|
| 168 | |
---|
| 169 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
| 170 | \item |
---|
| 171 | \hyperlink{libEF_8h}{libEF.h}\item |
---|
| 172 | libEF.cpp\end{CompactItemize} |
---|