[172] | 1 | \hypertarget{classmerger}{ |
---|
| 2 | \section{merger Class Reference} |
---|
| 3 | \label{classmerger}\index{merger@{merger}} |
---|
| 4 | } |
---|
| 5 | Function for general combination of pdfs. |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | {\tt \#include $<$merger.h$>$} |
---|
| 9 | |
---|
| 10 | Inheritance diagram for merger:\nopagebreak |
---|
| 11 | \begin{figure}[H] |
---|
| 12 | \begin{center} |
---|
| 13 | \leavevmode |
---|
[180] | 14 | \includegraphics[width=89pt]{classmerger__inherit__graph} |
---|
[172] | 15 | \end{center} |
---|
| 16 | \end{figure} |
---|
| 17 | Collaboration diagram for merger:\nopagebreak |
---|
| 18 | \begin{figure}[H] |
---|
| 19 | \begin{center} |
---|
| 20 | \leavevmode |
---|
| 21 | \includegraphics[height=400pt]{classmerger__coll__graph} |
---|
| 22 | \end{center} |
---|
| 23 | \end{figure} |
---|
| 24 | \subsection*{Public Member Functions} |
---|
| 25 | \begin{CompactItemize} |
---|
| 26 | \item |
---|
[180] | 27 | \hypertarget{classmerger_3f9a955329eab65026e8322e9027d469}{ |
---|
| 28 | \hyperlink{classmerger_3f9a955329eab65026e8322e9027d469}{merger} (const Array$<$ \hyperlink{classmpdf}{mpdf} $\ast$ $>$ \&S)} |
---|
| 29 | \label{classmerger_3f9a955329eab65026e8322e9027d469} |
---|
[172] | 30 | |
---|
| 31 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
[180] | 32 | \hypertarget{classmerger_79420e251308df4502c834171d518ad9}{ |
---|
| 33 | void \hyperlink{classmerger_79420e251308df4502c834171d518ad9}{set\_\-parameters} (double beta0, int Ns0, int Nc0)} |
---|
| 34 | \label{classmerger_79420e251308df4502c834171d518ad9} |
---|
[172] | 35 | |
---|
[180] | 36 | \begin{CompactList}\small\item\em Set internal parameters used in approximation. \item\end{CompactList}\item |
---|
| 37 | \hypertarget{classmerger_02d2a445e44a87f37ee3a2b9b40cffd1}{ |
---|
| 38 | void \hyperlink{classmerger_02d2a445e44a87f37ee3a2b9b40cffd1}{init} ()} |
---|
| 39 | \label{classmerger_02d2a445e44a87f37ee3a2b9b40cffd1} |
---|
[172] | 40 | |
---|
[180] | 41 | \begin{CompactList}\small\item\em Initialize the proposal density. This function must be called before \hyperlink{classmerger_bc23accc77ec766bce7202934e2c180c}{merge()}! \item\end{CompactList}\item |
---|
| 42 | \hypertarget{classmerger_e56ad4a2bc9be2ddfc051626adf27715}{ |
---|
| 43 | void \hyperlink{classmerger_e56ad4a2bc9be2ddfc051626adf27715}{merge} (const \hyperlink{classepdf}{epdf} $\ast$g0)} |
---|
| 44 | \label{classmerger_e56ad4a2bc9be2ddfc051626adf27715} |
---|
[172] | 45 | |
---|
[180] | 46 | \begin{CompactList}\small\item\em Create a mixture density using known proposal. \item\end{CompactList}\item |
---|
| 47 | \hypertarget{classmerger_bc23accc77ec766bce7202934e2c180c}{ |
---|
| 48 | void \hyperlink{classmerger_bc23accc77ec766bce7202934e2c180c}{merge} ()} |
---|
| 49 | \label{classmerger_bc23accc77ec766bce7202934e2c180c} |
---|
[172] | 50 | |
---|
[180] | 51 | \begin{CompactList}\small\item\em Create a mixture density, make sure to call \hyperlink{classmerger_02d2a445e44a87f37ee3a2b9b40cffd1}{init()} before the first call. \item\end{CompactList}\item |
---|
| 52 | \hypertarget{classmerger_217c65f335c603033fa09a2ecc64bc05}{ |
---|
| 53 | vec \hyperlink{classmerger_217c65f335c603033fa09a2ecc64bc05}{lognorm\_\-merge} (mat \&lW)} |
---|
| 54 | \label{classmerger_217c65f335c603033fa09a2ecc64bc05} |
---|
[172] | 55 | |
---|
[180] | 56 | \begin{CompactList}\small\item\em Merge log-likelihood values. \item\end{CompactList}\item |
---|
| 57 | vec \hyperlink{classmerger_379198c3d2063bfa63f5d1245a2511ba}{sample} () const |
---|
[172] | 58 | \item |
---|
[180] | 59 | \hypertarget{classmerger_8c37688902b1a1e9fa32edc5709e5a00}{ |
---|
| 60 | double \hyperlink{classmerger_8c37688902b1a1e9fa32edc5709e5a00}{evalpdflog} (const vec \&dt) const } |
---|
| 61 | \label{classmerger_8c37688902b1a1e9fa32edc5709e5a00} |
---|
[172] | 62 | |
---|
[180] | 63 | \begin{CompactList}\small\item\em Compute log-probability of argument {\tt val}. \item\end{CompactList}\item |
---|
| 64 | \hypertarget{classmerger_3a46999cd77047d5d4ac6c1cb735a83e}{ |
---|
| 65 | vec \hyperlink{classmerger_3a46999cd77047d5d4ac6c1cb735a83e}{mean} () const } |
---|
| 66 | \label{classmerger_3a46999cd77047d5d4ac6c1cb735a83e} |
---|
[172] | 67 | |
---|
[180] | 68 | \begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item |
---|
| 69 | \hypertarget{classmerger_51e425ee1dd46d73353526e6a1c24ca3}{ |
---|
| 70 | virtual \hyperlink{classmerger_51e425ee1dd46d73353526e6a1c24ca3}{$\sim$merger} ()} |
---|
| 71 | \label{classmerger_51e425ee1dd46d73353526e6a1c24ca3} |
---|
[172] | 72 | |
---|
[180] | 73 | \begin{CompactList}\small\item\em for future use \item\end{CompactList}\item |
---|
[181] | 74 | \hyperlink{classRV}{RV} \hyperlink{classcompositepdf_635d219fb3e32852400d6f98aa4bdc93}{getrv} (bool checkoverlap=false) |
---|
| 75 | \begin{CompactList}\small\item\em find common rv, flag \item\end{CompactList}\item |
---|
[180] | 76 | \hypertarget{classcompositepdf_5a4479785c1fdb2cc351fbea07b899ac}{ |
---|
[181] | 77 | void \hyperlink{classcompositepdf_5a4479785c1fdb2cc351fbea07b899ac}{setrvc} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}, \hyperlink{classRV}{RV} \&rvc)} |
---|
[180] | 78 | \label{classcompositepdf_5a4479785c1fdb2cc351fbea07b899ac} |
---|
[172] | 79 | |
---|
[181] | 80 | \begin{CompactList}\small\item\em common rvc of all mpdfs is written to rvc \item\end{CompactList}\item |
---|
[180] | 81 | \hypertarget{classcompositepdf_08958c8f76d65de94ecc37b8d90bc77a}{ |
---|
[181] | 82 | void \hyperlink{classcompositepdf_08958c8f76d65de94ecc37b8d90bc77a}{setindices} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv})} |
---|
[180] | 83 | \label{classcompositepdf_08958c8f76d65de94ecc37b8d90bc77a} |
---|
[172] | 84 | |
---|
[181] | 85 | \begin{CompactList}\small\item\em fill all rv$\ast$inrv$\ast$ according to \item\end{CompactList}\item |
---|
[180] | 86 | \hypertarget{classcompositepdf_3bd4ada95f381ea6c4cff2dc86e957c4}{ |
---|
[181] | 87 | void \hyperlink{classcompositepdf_3bd4ada95f381ea6c4cff2dc86e957c4}{setrvcinrv} (const \hyperlink{classRV}{RV} \&rvc, Array$<$ ivec $>$ \&rvcind)} |
---|
[180] | 88 | \label{classcompositepdf_3bd4ada95f381ea6c4cff2dc86e957c4} |
---|
[172] | 89 | |
---|
[181] | 90 | \begin{CompactList}\small\item\em Function fills Array by indeces of mpdfs inside given rv. \item\end{CompactList}\item |
---|
[180] | 91 | \hypertarget{classepdf_54d7dd53a641b618771cd9bee135181f}{ |
---|
| 92 | virtual mat \hyperlink{classepdf_54d7dd53a641b618771cd9bee135181f}{sampleN} (int N) const } |
---|
| 93 | \label{classepdf_54d7dd53a641b618771cd9bee135181f} |
---|
[172] | 94 | |
---|
[180] | 95 | \begin{CompactList}\small\item\em Returns N samples from density $epdf(rv)$. \item\end{CompactList}\item |
---|
| 96 | \hypertarget{classepdf_3ea597362e11a0040fe7c990269d072c}{ |
---|
| 97 | virtual double \hyperlink{classepdf_3ea597362e11a0040fe7c990269d072c}{eval} (const vec \&val) const } |
---|
| 98 | \label{classepdf_3ea597362e11a0040fe7c990269d072c} |
---|
[172] | 99 | |
---|
[180] | 100 | \begin{CompactList}\small\item\em Compute probability of argument {\tt val}. \item\end{CompactList}\item |
---|
| 101 | \hypertarget{classepdf_cebbdd7a85e6328f7358fc0ba8eee06c}{ |
---|
| 102 | virtual vec \hyperlink{classepdf_cebbdd7a85e6328f7358fc0ba8eee06c}{evalpdflog\_\-m} (const mat \&Val) const } |
---|
| 103 | \label{classepdf_cebbdd7a85e6328f7358fc0ba8eee06c} |
---|
[172] | 104 | |
---|
[180] | 105 | \begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item |
---|
[181] | 106 | \hypertarget{classepdf_3ba08c0e788deff22134c049b9269666}{ |
---|
| 107 | \hyperlink{classmpdf}{mpdf} $\ast$ \hyperlink{classepdf_3ba08c0e788deff22134c049b9269666}{condition} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv})} |
---|
| 108 | \label{classepdf_3ba08c0e788deff22134c049b9269666} |
---|
| 109 | |
---|
| 110 | \begin{CompactList}\small\item\em Return conditional density on the given \hyperlink{classRV}{RV}, the remaining rvs will be in conditioning. \item\end{CompactList}\item |
---|
| 111 | \hypertarget{classepdf_bc0c171b6dafacd78d26263913b1d0c0}{ |
---|
| 112 | \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classepdf_bc0c171b6dafacd78d26263913b1d0c0}{marginal} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv})} |
---|
| 113 | \label{classepdf_bc0c171b6dafacd78d26263913b1d0c0} |
---|
| 114 | |
---|
| 115 | \begin{CompactList}\small\item\em Return marginal density on the given \hyperlink{classRV}{RV}, the remainig rvs are intergrated out. \item\end{CompactList}\item |
---|
[180] | 116 | \hypertarget{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{ |
---|
| 117 | const \hyperlink{classRV}{RV} \& \hyperlink{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{\_\-rv} () const } |
---|
| 118 | \label{classepdf_ca0d32aabb4cbba347e0c37fe8607562} |
---|
[172] | 119 | |
---|
[180] | 120 | \begin{CompactList}\small\item\em access function, possibly dangerous! \item\end{CompactList}\item |
---|
| 121 | \hypertarget{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{ |
---|
| 122 | void \hyperlink{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{\_\-renewrv} (const \hyperlink{classRV}{RV} \&in\_\-rv)} |
---|
| 123 | \label{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5} |
---|
[172] | 124 | |
---|
[180] | 125 | \begin{CompactList}\small\item\em modifier function - useful when copying epdfs \item\end{CompactList}\end{CompactItemize} |
---|
| 126 | \subsection*{Protected Attributes} |
---|
| 127 | \begin{CompactItemize} |
---|
| 128 | \item |
---|
| 129 | \hypertarget{classmerger_021d1522cea70db8545d708afd32ec2f}{ |
---|
| 130 | \hyperlink{classMixEF}{MixEF} \hyperlink{classmerger_021d1522cea70db8545d708afd32ec2f}{Mix}} |
---|
| 131 | \label{classmerger_021d1522cea70db8545d708afd32ec2f} |
---|
[172] | 132 | |
---|
[180] | 133 | \begin{CompactList}\small\item\em Internal mixture of EF models. \item\end{CompactList}\item |
---|
| 134 | \hypertarget{classmerger_ce84de1824875b4262eefb640e8c6d69}{ |
---|
| 135 | int \hyperlink{classmerger_ce84de1824875b4262eefb640e8c6d69}{Ns}} |
---|
| 136 | \label{classmerger_ce84de1824875b4262eefb640e8c6d69} |
---|
[172] | 137 | |
---|
[180] | 138 | \begin{CompactList}\small\item\em Number of samples used in approximation. \item\end{CompactList}\item |
---|
| 139 | \hypertarget{classmerger_6acf33e1c64aaaee20689725e8110f65}{ |
---|
| 140 | int \hyperlink{classmerger_6acf33e1c64aaaee20689725e8110f65}{Nc}} |
---|
| 141 | \label{classmerger_6acf33e1c64aaaee20689725e8110f65} |
---|
[172] | 142 | |
---|
[180] | 143 | \begin{CompactList}\small\item\em Number of components in a mixture. \item\end{CompactList}\item |
---|
| 144 | \hypertarget{classmerger_e68a72e2740007ae68545e378c7701ad}{ |
---|
| 145 | double \hyperlink{classmerger_e68a72e2740007ae68545e378c7701ad}{beta}} |
---|
| 146 | \label{classmerger_e68a72e2740007ae68545e378c7701ad} |
---|
[172] | 147 | |
---|
[180] | 148 | \begin{CompactList}\small\item\em Prior on the log-normal merging model. \item\end{CompactList}\item |
---|
| 149 | \hypertarget{classcompositepdf_c1646fe41ff5934d010e54ccaa46133f}{ |
---|
| 150 | int \hyperlink{classcompositepdf_c1646fe41ff5934d010e54ccaa46133f}{n}} |
---|
| 151 | \label{classcompositepdf_c1646fe41ff5934d010e54ccaa46133f} |
---|
[172] | 152 | |
---|
[180] | 153 | \begin{CompactList}\small\item\em Number of mpdfs in the composite. \item\end{CompactList}\item |
---|
| 154 | \hypertarget{classcompositepdf_637877061b917a16a0421bb5c4cd480d}{ |
---|
| 155 | Array$<$ \hyperlink{classmpdf}{mpdf} $\ast$ $>$ \hyperlink{classcompositepdf_637877061b917a16a0421bb5c4cd480d}{mpdfs}} |
---|
| 156 | \label{classcompositepdf_637877061b917a16a0421bb5c4cd480d} |
---|
[172] | 157 | |
---|
[180] | 158 | \begin{CompactList}\small\item\em Elements of composition. \item\end{CompactList}\item |
---|
| 159 | \hypertarget{classcompositepdf_4d4a8269f9faefeca8cdc251a5a29a7f}{ |
---|
| 160 | Array$<$ ivec $>$ \hyperlink{classcompositepdf_4d4a8269f9faefeca8cdc251a5a29a7f}{rvsinrv}} |
---|
| 161 | \label{classcompositepdf_4d4a8269f9faefeca8cdc251a5a29a7f} |
---|
[172] | 162 | |
---|
[180] | 163 | \begin{CompactList}\small\item\em Indeces of rvs in common rv. \item\end{CompactList}\item |
---|
| 164 | \hypertarget{classcompositepdf_3df07bb5e3ed36a3119b145043296676}{ |
---|
| 165 | Array$<$ ivec $>$ \hyperlink{classcompositepdf_3df07bb5e3ed36a3119b145043296676}{rvcsinrv}} |
---|
| 166 | \label{classcompositepdf_3df07bb5e3ed36a3119b145043296676} |
---|
[172] | 167 | |
---|
[180] | 168 | \begin{CompactList}\small\item\em Indeces of rvc in common rv. \item\end{CompactList}\item |
---|
[181] | 169 | \hypertarget{classcompositepdf_de3bd289a26d5549dcf1ed19e5b13569}{ |
---|
| 170 | Array$<$ ivec $>$ \hyperlink{classcompositepdf_de3bd289a26d5549dcf1ed19e5b13569}{rvinrvcs}} |
---|
| 171 | \label{classcompositepdf_de3bd289a26d5549dcf1ed19e5b13569} |
---|
| 172 | |
---|
| 173 | \begin{CompactList}\small\item\em Indeces of common rv in rvc. \item\end{CompactList}\item |
---|
[180] | 174 | \hypertarget{classepdf_74da992e3f5d598da8850b646b79b9d9}{ |
---|
| 175 | \hyperlink{classRV}{RV} \hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}} |
---|
| 176 | \label{classepdf_74da992e3f5d598da8850b646b79b9d9} |
---|
[172] | 177 | |
---|
[180] | 178 | \begin{CompactList}\small\item\em Identified of the random variable. \item\end{CompactList}\end{CompactItemize} |
---|
[172] | 179 | |
---|
| 180 | |
---|
[180] | 181 | \subsection{Detailed Description} |
---|
| 182 | Function for general combination of pdfs. |
---|
[172] | 183 | |
---|
[180] | 184 | Mixtures of Gaussian densities are used internally. Switching to other densities should be trivial. |
---|
[172] | 185 | |
---|
[180] | 186 | \subsection{Member Function Documentation} |
---|
| 187 | \hypertarget{classmerger_379198c3d2063bfa63f5d1245a2511ba}{ |
---|
| 188 | \index{merger@{merger}!sample@{sample}} |
---|
| 189 | \index{sample@{sample}!merger@{merger}} |
---|
| 190 | \subsubsection[sample]{\setlength{\rightskip}{0pt plus 5cm}vec merger::sample () const\hspace{0.3cm}{\tt \mbox{[}inline, virtual\mbox{]}}}} |
---|
| 191 | \label{classmerger_379198c3d2063bfa63f5d1245a2511ba} |
---|
[172] | 192 | |
---|
| 193 | |
---|
[180] | 194 | sample from merged density weight w is a |
---|
[172] | 195 | |
---|
[180] | 196 | Implements \hyperlink{classepdf_8019654e494bf5e458f6fb947e11b262}{epdf}. |
---|
[172] | 197 | |
---|
[181] | 198 | References MixEF::\_\-epdf(), Mix, and epdf::sample().\hypertarget{classcompositepdf_635d219fb3e32852400d6f98aa4bdc93}{ |
---|
| 199 | \index{merger@{merger}!getrv@{getrv}} |
---|
| 200 | \index{getrv@{getrv}!merger@{merger}} |
---|
| 201 | \subsubsection[getrv]{\setlength{\rightskip}{0pt plus 5cm}{\bf RV} compositepdf::getrv (bool {\em checkoverlap} = {\tt false})\hspace{0.3cm}{\tt \mbox{[}inherited\mbox{]}}}} |
---|
| 202 | \label{classcompositepdf_635d219fb3e32852400d6f98aa4bdc93} |
---|
[172] | 203 | |
---|
[181] | 204 | |
---|
| 205 | find common rv, flag |
---|
| 206 | |
---|
| 207 | \begin{Desc} |
---|
| 208 | \item[Parameters:] |
---|
| 209 | \begin{description} |
---|
| 210 | \item[{\em checkoverlap}]modifies whether overlaps are acceptable \end{description} |
---|
| 211 | \end{Desc} |
---|
| 212 | |
---|
| 213 | |
---|
| 214 | References RV::add(), compositepdf::mpdfs, and compositepdf::n. |
---|
| 215 | |
---|
[180] | 216 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
[172] | 217 | \item |
---|
[180] | 218 | work/git/mixpp/bdm/estim/\hyperlink{merger_8h}{merger.h}\item |
---|
| 219 | work/git/mixpp/bdm/estim/merger.cpp\end{CompactItemize} |
---|