root/doc/latex/classbdm_1_1merger.tex @ 270

Revision 270, 14.5 kB (checked in by smidl, 16 years ago)

Changes in the very root classes!
* rv and rvc are no longer compulsory,
* samplecond does not return ll
* BM has drv

Line 
1\hypertarget{classbdm_1_1merger}{
2\section{bdm::merger Class Reference}
3\label{classbdm_1_1merger}\index{bdm::merger@{bdm::merger}}
4}
5{\tt \#include $<$merger.h$>$}
6
7Inheritance diagram for bdm::merger:\nopagebreak
8\begin{figure}[H]
9\begin{center}
10\leavevmode
11\includegraphics[width=122pt]{classbdm_1_1merger__inherit__graph}
12\end{center}
13\end{figure}
14
15
16\subsection{Detailed Description}
17Function for general combination of pdfs.
18
19Mixtures of Gaussian densities are used internally. Switching to other densities should be trivial. \subsection*{Public Member Functions}
20\begin{CompactItemize}
21\item 
22\hypertarget{classbdm_1_1merger_30ae0fa8a88737185f598bf63fec0569}{
23\hyperlink{classbdm_1_1merger_30ae0fa8a88737185f598bf63fec0569}{merger} (const Array$<$ \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ $>$ \&S)}
24\label{classbdm_1_1merger_30ae0fa8a88737185f598bf63fec0569}
25
26\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
27\hypertarget{classbdm_1_1merger_bc867c8e2b4709041bf8802ae9c78e37}{
28void \hyperlink{classbdm_1_1merger_bc867c8e2b4709041bf8802ae9c78e37}{set\_\-parameters} (double beta0, int Ns0, int Nc0)}
29\label{classbdm_1_1merger_bc867c8e2b4709041bf8802ae9c78e37}
30
31\begin{CompactList}\small\item\em Set internal parameters used in approximation. \item\end{CompactList}\item 
32\hypertarget{classbdm_1_1merger_8ae79a651e93d6e2d611556001af8aa8}{
33void \hyperlink{classbdm_1_1merger_8ae79a651e93d6e2d611556001af8aa8}{init} ()}
34\label{classbdm_1_1merger_8ae79a651e93d6e2d611556001af8aa8}
35
36\begin{CompactList}\small\item\em Initialize the proposal density. This function must be called before \hyperlink{classbdm_1_1merger_b72f4662c9ac760a8b17ebe5d697f3c2}{merge()}! \item\end{CompactList}\item 
37\hypertarget{classbdm_1_1merger_3d9f0ba04c8e74be8246d840cc537879}{
38void \hyperlink{classbdm_1_1merger_3d9f0ba04c8e74be8246d840cc537879}{merge} (const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$g0)}
39\label{classbdm_1_1merger_3d9f0ba04c8e74be8246d840cc537879}
40
41\begin{CompactList}\small\item\em Create a mixture density using known proposal. \item\end{CompactList}\item 
42\hypertarget{classbdm_1_1merger_b72f4662c9ac760a8b17ebe5d697f3c2}{
43void \hyperlink{classbdm_1_1merger_b72f4662c9ac760a8b17ebe5d697f3c2}{merge} ()}
44\label{classbdm_1_1merger_b72f4662c9ac760a8b17ebe5d697f3c2}
45
46\begin{CompactList}\small\item\em Create a mixture density, make sure to call \hyperlink{classbdm_1_1merger_8ae79a651e93d6e2d611556001af8aa8}{init()} before the first call. \item\end{CompactList}\item 
47\hypertarget{classbdm_1_1merger_b90f1b8a21a693176dd953a3b983aa0b}{
48vec \hyperlink{classbdm_1_1merger_b90f1b8a21a693176dd953a3b983aa0b}{lognorm\_\-merge} (mat \&lW)}
49\label{classbdm_1_1merger_b90f1b8a21a693176dd953a3b983aa0b}
50
51\begin{CompactList}\small\item\em Merge log-likelihood values. \item\end{CompactList}\item 
52vec \hyperlink{classbdm_1_1merger_0ef73e76eeee44c8e3896e3a271ad974}{sample} () const
53\item 
54\hypertarget{classbdm_1_1merger_c47543661897638cab9f506c76a1f92f}{
55double \hyperlink{classbdm_1_1merger_c47543661897638cab9f506c76a1f92f}{evallog} (const vec \&dt) const }
56\label{classbdm_1_1merger_c47543661897638cab9f506c76a1f92f}
57
58\begin{CompactList}\small\item\em Compute log-probability of argument {\tt val}. \item\end{CompactList}\item 
59\hypertarget{classbdm_1_1merger_82c5ad7677315fde8e9fc9381c17ece5}{
60vec \hyperlink{classbdm_1_1merger_82c5ad7677315fde8e9fc9381c17ece5}{mean} () const }
61\label{classbdm_1_1merger_82c5ad7677315fde8e9fc9381c17ece5}
62
63\begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item 
64\hypertarget{classbdm_1_1merger_88e75fe2b9d7c1247b20ea7760c061f1}{
65mat \textbf{covariance} () const }
66\label{classbdm_1_1merger_88e75fe2b9d7c1247b20ea7760c061f1}
67
68\item 
69\hypertarget{classbdm_1_1merger_bcef70ece256b1ab1fa7a3a354eb1cc4}{
70vec \hyperlink{classbdm_1_1merger_bcef70ece256b1ab1fa7a3a354eb1cc4}{variance} () const }
71\label{classbdm_1_1merger_bcef70ece256b1ab1fa7a3a354eb1cc4}
72
73\begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\item 
74\hypertarget{classbdm_1_1merger_febef179bb5e074ae6e34d15b4596273}{
75virtual \hyperlink{classbdm_1_1merger_febef179bb5e074ae6e34d15b4596273}{$\sim$merger} ()}
76\label{classbdm_1_1merger_febef179bb5e074ae6e34d15b4596273}
77
78\begin{CompactList}\small\item\em for future use \item\end{CompactList}\item 
79\hypertarget{classbdm_1_1merger_13f8534f626a37bed91a6d9db54d6d2f}{
80\hyperlink{classbdm_1_1MixEF}{MixEF} \& \hyperlink{classbdm_1_1merger_13f8534f626a37bed91a6d9db54d6d2f}{\_\-Mix} ()}
81\label{classbdm_1_1merger_13f8534f626a37bed91a6d9db54d6d2f}
82
83\begin{CompactList}\small\item\em Access function. \item\end{CompactList}\item 
84\hypertarget{classbdm_1_1merger_23f5f8b80df579b05681006fbcfe3699}{
85\hyperlink{classbdm_1_1eEmp}{eEmp} \& \hyperlink{classbdm_1_1merger_23f5f8b80df579b05681006fbcfe3699}{\_\-Smp} ()}
86\label{classbdm_1_1merger_23f5f8b80df579b05681006fbcfe3699}
87
88\begin{CompactList}\small\item\em Access function. \item\end{CompactList}\item 
89\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1compositepdf_c73d39acc4378eee6a63155c3517d3c9}{getrv} (bool checkoverlap=false)
90\begin{CompactList}\small\item\em find common rv, flag \item\end{CompactList}\item 
91\hypertarget{classbdm_1_1compositepdf_c71fc2c51f49d797e61f479f543c75ce}{
92void \hyperlink{classbdm_1_1compositepdf_c71fc2c51f49d797e61f479f543c75ce}{setrvc} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}, \hyperlink{classbdm_1_1RV}{RV} \&rvc)}
93\label{classbdm_1_1compositepdf_c71fc2c51f49d797e61f479f543c75ce}
94
95\begin{CompactList}\small\item\em common rvc of all mpdfs is written to rvc \item\end{CompactList}\end{CompactItemize}
96\begin{Indent}{\bf Matematical Operations}\par
97\begin{CompactItemize}
98\item 
99\hypertarget{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{
100virtual mat \hyperlink{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{sample\_\-m} (int N) const }
101\label{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}
102
103\begin{CompactList}\small\item\em Returns N samples, $ [x_1 , x_2 , \ldots \ $ from density $ f_x(rv)$. \item\end{CompactList}\item 
104\hypertarget{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{
105virtual vec \hyperlink{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{evallog\_\-m} (const mat \&Val) const }
106\label{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}
107
108\begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item 
109\hypertarget{classbdm_1_1epdf_e584eac5579c1b6384947ecf66166c77}{
110virtual \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 }
111\label{classbdm_1_1epdf_e584eac5579c1b6384947ecf66166c77}
112
113\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 
114\hypertarget{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}{
115virtual \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 }
116\label{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}
117
118\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}
119\end{Indent}
120\begin{Indent}{\bf Connection to other classes}\par
121{\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}
122\item 
123\hypertarget{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{
124void \hyperlink{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{set\_\-rv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0)}
125\label{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}
126
127\begin{CompactList}\small\item\em Name its rv. \item\end{CompactList}\item 
128\hypertarget{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{
129bool \hyperlink{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{isnamed} () const }
130\label{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}
131
132\begin{CompactList}\small\item\em True if rv is assigned. \item\end{CompactList}\item 
133\hypertarget{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{
134const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{\_\-rv} () const }
135\label{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}
136
137\begin{CompactList}\small\item\em Return name (fails when isnamed is false). \item\end{CompactList}\end{CompactItemize}
138\end{Indent}
139\begin{Indent}{\bf Access to attributes}\par
140\begin{CompactItemize}
141\item 
142\hypertarget{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}{
143bool \hyperlink{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}{dimension} () const }
144\label{classbdm_1_1epdf_46dfe100cd621716ee5c7ee25a20f24b}
145
146\begin{CompactList}\small\item\em Size of the random variable. \item\end{CompactList}\end{CompactItemize}
147\end{Indent}
148\subsection*{Protected Attributes}
149\begin{CompactItemize}
150\item 
151\hypertarget{classbdm_1_1merger_67ae71cbf0686d7c7bf116fa5db86d81}{
152\hyperlink{classbdm_1_1MixEF}{MixEF} \hyperlink{classbdm_1_1merger_67ae71cbf0686d7c7bf116fa5db86d81}{Mix}}
153\label{classbdm_1_1merger_67ae71cbf0686d7c7bf116fa5db86d81}
154
155\begin{CompactList}\small\item\em Internal mixture of EF models. \item\end{CompactList}\item 
156\hypertarget{classbdm_1_1merger_ea3c9f4739f857877fd5285b3973289c}{
157Array$<$ \hyperlink{classbdm_1_1datalink__m2e}{datalink\_\-m2e} $\ast$ $>$ \hyperlink{classbdm_1_1merger_ea3c9f4739f857877fd5285b3973289c}{dls}}
158\label{classbdm_1_1merger_ea3c9f4739f857877fd5285b3973289c}
159
160\begin{CompactList}\small\item\em Data link for each \hyperlink{classbdm_1_1mpdf}{mpdf} in mpdfs. \item\end{CompactList}\item 
161\hypertarget{classbdm_1_1merger_135b938f841cb88ad00a8bbded818703}{
162Array$<$ \hyperlink{classbdm_1_1RV}{RV} $>$ \hyperlink{classbdm_1_1merger_135b938f841cb88ad00a8bbded818703}{rvzs}}
163\label{classbdm_1_1merger_135b938f841cb88ad00a8bbded818703}
164
165\begin{CompactList}\small\item\em Array of rvs that are not modelled by mpdfs at all (aux). \item\end{CompactList}\item 
166\hypertarget{classbdm_1_1merger_6c48bf36ec1f3f7b52e3159cf428a193}{
167Array$<$ \hyperlink{classbdm_1_1datalink__m2e}{datalink\_\-m2e} $\ast$ $>$ \hyperlink{classbdm_1_1merger_6c48bf36ec1f3f7b52e3159cf428a193}{zdls}}
168\label{classbdm_1_1merger_6c48bf36ec1f3f7b52e3159cf428a193}
169
170\begin{CompactList}\small\item\em Data Links of rv0 mpdfs - these will be conditioned the (rv,rvc) of mpdfs. \item\end{CompactList}\item 
171\hypertarget{classbdm_1_1merger_e91b83e6d9076848c71ae27664072109}{
172int \hyperlink{classbdm_1_1merger_e91b83e6d9076848c71ae27664072109}{Ns}}
173\label{classbdm_1_1merger_e91b83e6d9076848c71ae27664072109}
174
175\begin{CompactList}\small\item\em Number of samples used in approximation. \item\end{CompactList}\item 
176\hypertarget{classbdm_1_1merger_214ca7c566e8f75d45bb243d7c74580d}{
177int \hyperlink{classbdm_1_1merger_214ca7c566e8f75d45bb243d7c74580d}{Nc}}
178\label{classbdm_1_1merger_214ca7c566e8f75d45bb243d7c74580d}
179
180\begin{CompactList}\small\item\em Number of components in a mixture. \item\end{CompactList}\item 
181\hypertarget{classbdm_1_1merger_1a85d299f202a70afe0cdc1045c26a5d}{
182double \hyperlink{classbdm_1_1merger_1a85d299f202a70afe0cdc1045c26a5d}{beta}}
183\label{classbdm_1_1merger_1a85d299f202a70afe0cdc1045c26a5d}
184
185\begin{CompactList}\small\item\em Prior on the log-normal merging model. \item\end{CompactList}\item 
186\hypertarget{classbdm_1_1merger_522d43f7aa13fe6701e93fba174dec94}{
187\hyperlink{classbdm_1_1eEmp}{eEmp} \hyperlink{classbdm_1_1merger_522d43f7aa13fe6701e93fba174dec94}{eSmp}}
188\label{classbdm_1_1merger_522d43f7aa13fe6701e93fba174dec94}
189
190\begin{CompactList}\small\item\em Projection to empirical density. \item\end{CompactList}\item 
191\hypertarget{classbdm_1_1compositepdf_7ca3cd8ed92a7154f5b9ff13b1e9d52a}{
192int \hyperlink{classbdm_1_1compositepdf_7ca3cd8ed92a7154f5b9ff13b1e9d52a}{n}}
193\label{classbdm_1_1compositepdf_7ca3cd8ed92a7154f5b9ff13b1e9d52a}
194
195\begin{CompactList}\small\item\em Number of mpdfs in the composite. \item\end{CompactList}\item 
196\hypertarget{classbdm_1_1compositepdf_23faf2debc4dde10836393b8c665914a}{
197Array$<$ \hyperlink{classbdm_1_1mpdf}{mpdf} $\ast$ $>$ \hyperlink{classbdm_1_1compositepdf_23faf2debc4dde10836393b8c665914a}{mpdfs}}
198\label{classbdm_1_1compositepdf_23faf2debc4dde10836393b8c665914a}
199
200\begin{CompactList}\small\item\em Elements of composition. \item\end{CompactList}\item 
201\hypertarget{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}{
202int \hyperlink{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}{dim}}
203\label{classbdm_1_1epdf_16adac20ec7fe07e1ea0b27d917788ce}
204
205\begin{CompactList}\small\item\em dimension of the random variable \item\end{CompactList}\item 
206\hypertarget{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{
207\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}}
208\label{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}
209
210\begin{CompactList}\small\item\em Description of the random variable. \item\end{CompactList}\end{CompactItemize}
211
212
213\subsection{Member Function Documentation}
214\hypertarget{classbdm_1_1merger_0ef73e76eeee44c8e3896e3a271ad974}{
215\index{bdm::merger@{bdm::merger}!sample@{sample}}
216\index{sample@{sample}!bdm::merger@{bdm::merger}}
217\subsubsection[sample]{\setlength{\rightskip}{0pt plus 5cm}vec bdm::merger::sample () const\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}
218\label{classbdm_1_1merger_0ef73e76eeee44c8e3896e3a271ad974}
219
220
221sample from merged density weight w is a
222
223Implements \hyperlink{classbdm_1_1epdf_09721eb148bc49d6ec2f1956039f3a10}{bdm::epdf}.
224
225References bdm::MixEF::\_\-epdf(), Mix, and bdm::epdf::sample().\hypertarget{classbdm_1_1compositepdf_c73d39acc4378eee6a63155c3517d3c9}{
226\index{bdm::merger@{bdm::merger}!getrv@{getrv}}
227\index{getrv@{getrv}!bdm::merger@{bdm::merger}}
228\subsubsection[getrv]{\setlength{\rightskip}{0pt plus 5cm}{\bf RV} bdm::compositepdf::getrv (bool {\em checkoverlap} = {\tt false})\hspace{0.3cm}{\tt  \mbox{[}inherited\mbox{]}}}}
229\label{classbdm_1_1compositepdf_c73d39acc4378eee6a63155c3517d3c9}
230
231
232find common rv, flag
233
234\begin{Desc}
235\item[Parameters:]
236\begin{description}
237\item[{\em checkoverlap}]modifies whether overlaps are acceptable \end{description}
238\end{Desc}
239
240
241References bdm::RV::add(), bdm::compositepdf::mpdfs, and bdm::compositepdf::n.
242
243The documentation for this class was generated from the following files:\begin{CompactItemize}
244\item 
245\hyperlink{merger_8h}{merger.h}\item 
246merger.cpp\end{CompactItemize}
Note: See TracBrowser for help on using the browser.