root/doc/latex/classmratio.tex @ 248

Revision 234, 9.4 kB (checked in by smidl, 16 years ago)

doc

Line 
1\hypertarget{classmratio}{
2\section{mratio Class Reference}
3\label{classmratio}\index{mratio@{mratio}}
4}
5Class representing ratio of two densities which arise e.g. by applying the Bayes rule. It represents density in the form: \[ f(rv|rvc) = \frac{f(rv,rvc)}{f(rvc)} \] where $ f(rvc) = \int f(rv,rvc) d\ rv $
6
7
8{\tt \#include $<$emix.h$>$}
9
10Inheritance diagram for mratio:\nopagebreak
11\begin{figure}[H]
12\begin{center}
13\leavevmode
14\includegraphics[width=46pt]{classmratio__inherit__graph}
15\end{center}
16\end{figure}
17Collaboration diagram for mratio:\nopagebreak
18\begin{figure}[H]
19\begin{center}
20\leavevmode
21\includegraphics[width=120pt]{classmratio__coll__graph}
22\end{center}
23\end{figure}
24\subsection*{Public Member Functions}
25\begin{CompactItemize}
26\item 
27\hyperlink{classmratio_c2452f4fc3046cfe8f2453deb343b3ac}{mratio} (const \hyperlink{classepdf}{epdf} $\ast$nom0, const \hyperlink{classRV}{RV} \&\hyperlink{classmpdf_f6687c07ff07d47812dd565368ca59eb}{rv}, bool copy=false)
28\item 
29\hypertarget{classmratio_9fb0df09a2e975e8b9f7ce41ecd65a09}{
30double \hyperlink{classmratio_9fb0df09a2e975e8b9f7ce41ecd65a09}{evallogcond} (const vec \&val, const vec \&cond)}
31\label{classmratio_9fb0df09a2e975e8b9f7ce41ecd65a09}
32
33\begin{CompactList}\small\item\em Shortcut for conditioning and evaluation of the internal \hyperlink{classepdf}{epdf}. In some cases, this operation can be implemented efficiently. \item\end{CompactList}\item 
34\hypertarget{classmratio_41d6d8f4245f67c732299ba7167aacb9}{
35void \hyperlink{classmratio_41d6d8f4245f67c732299ba7167aacb9}{ownnom} ()}
36\label{classmratio_41d6d8f4245f67c732299ba7167aacb9}
37
38\begin{CompactList}\small\item\em Object takes ownership of nom and will destroy it. \item\end{CompactList}\item 
39\hypertarget{classmratio_e62904f18041e73228d8db671e517280}{
40\hyperlink{classmratio_e62904f18041e73228d8db671e517280}{$\sim$mratio} ()}
41\label{classmratio_e62904f18041e73228d8db671e517280}
42
43\begin{CompactList}\small\item\em Default destructor. \item\end{CompactList}\item 
44virtual vec \hyperlink{classmpdf_3f172b79ec4a5ebc87898a5381141f1b}{samplecond} (const vec \&cond, double \&ll)
45\begin{CompactList}\small\item\em Returns a sample from the density conditioned on {\tt cond}, $x \sim epdf(rv|cond)$. \item\end{CompactList}\item 
46virtual mat \hyperlink{classmpdf_b1dae6171ee39a6a05976c7b1007a3c5}{samplecond\_\-m} (const vec \&cond, vec \&ll, int N)
47\begin{CompactList}\small\item\em Returns. \item\end{CompactList}\item 
48\hypertarget{classmpdf_0f95a0cc6ab40611f46804682446ed83}{
49virtual void \hyperlink{classmpdf_0f95a0cc6ab40611f46804682446ed83}{condition} (const vec \&cond)}
50\label{classmpdf_0f95a0cc6ab40611f46804682446ed83}
51
52\begin{CompactList}\small\item\em Update {\tt ep} so that it represents this \hyperlink{classmpdf}{mpdf} conditioned on {\tt rvc} = cond. \item\end{CompactList}\item 
53\hypertarget{classmpdf_95fcff214848f66f1b489459370573fa}{
54virtual vec \hyperlink{classmpdf_95fcff214848f66f1b489459370573fa}{evallogcond\_\-m} (const mat \&Dt, const vec \&cond)}
55\label{classmpdf_95fcff214848f66f1b489459370573fa}
56
57\begin{CompactList}\small\item\em Matrix version of evallogcond. \item\end{CompactList}\item 
58\hypertarget{classmpdf_15ef062183b1ccdf794732d5fa0b77cd}{
59\hyperlink{classRV}{RV} \hyperlink{classmpdf_15ef062183b1ccdf794732d5fa0b77cd}{\_\-rvc} () const }
60\label{classmpdf_15ef062183b1ccdf794732d5fa0b77cd}
61
62\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
63\hypertarget{classmpdf_71256ffb5fbd08f41d650e606a5bd585}{
64\hyperlink{classRV}{RV} \hyperlink{classmpdf_71256ffb5fbd08f41d650e606a5bd585}{\_\-rv} () const }
65\label{classmpdf_71256ffb5fbd08f41d650e606a5bd585}
66
67\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
68\hypertarget{classmpdf_e17780ee5b2cfe05922a6c56af1462f8}{
69\hyperlink{classepdf}{epdf} \& \hyperlink{classmpdf_e17780ee5b2cfe05922a6c56af1462f8}{\_\-epdf} ()}
70\label{classmpdf_e17780ee5b2cfe05922a6c56af1462f8}
71
72\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
73\hypertarget{classmpdf_75ded3b0f657cd7da6590691a810963c}{
74\hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classmpdf_75ded3b0f657cd7da6590691a810963c}{\_\-e} ()}
75\label{classmpdf_75ded3b0f657cd7da6590691a810963c}
76
77\begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize}
78\subsection*{Protected Attributes}
79\begin{CompactItemize}
80\item 
81\hypertarget{classmratio_8a3e60f5a532237e4450cd06039a28db}{
82const \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classmratio_8a3e60f5a532237e4450cd06039a28db}{nom}}
83\label{classmratio_8a3e60f5a532237e4450cd06039a28db}
84
85\begin{CompactList}\small\item\em Nominator in the form of \hyperlink{classmpdf}{mpdf}. \item\end{CompactList}\item 
86\hypertarget{classmratio_d34916f6403460fbcac71902f32aa791}{
87\hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classmratio_d34916f6403460fbcac71902f32aa791}{den}}
88\label{classmratio_d34916f6403460fbcac71902f32aa791}
89
90\begin{CompactList}\small\item\em Denominator in the form of \hyperlink{classepdf}{epdf}. \item\end{CompactList}\item 
91\hypertarget{classmratio_f8ea9dd72239dc24b1d83ae034424285}{
92bool \hyperlink{classmratio_f8ea9dd72239dc24b1d83ae034424285}{destroynom}}
93\label{classmratio_f8ea9dd72239dc24b1d83ae034424285}
94
95\begin{CompactList}\small\item\em flag for destructor \item\end{CompactList}\item 
96\hypertarget{classmratio_aa50f2cca2b959391f449241ef89012d}{
97\hyperlink{classdatalink__m2e}{datalink\_\-m2e} \hyperlink{classmratio_aa50f2cca2b959391f449241ef89012d}{dl}}
98\label{classmratio_aa50f2cca2b959391f449241ef89012d}
99
100\begin{CompactList}\small\item\em datalink between conditional and nom \item\end{CompactList}\item 
101\hypertarget{classmpdf_f6687c07ff07d47812dd565368ca59eb}{
102\hyperlink{classRV}{RV} \hyperlink{classmpdf_f6687c07ff07d47812dd565368ca59eb}{rv}}
103\label{classmpdf_f6687c07ff07d47812dd565368ca59eb}
104
105\begin{CompactList}\small\item\em modeled random variable \item\end{CompactList}\item 
106\hypertarget{classmpdf_acb7dda792b3cd5576f39fa3129abbab}{
107\hyperlink{classRV}{RV} \hyperlink{classmpdf_acb7dda792b3cd5576f39fa3129abbab}{rvc}}
108\label{classmpdf_acb7dda792b3cd5576f39fa3129abbab}
109
110\begin{CompactList}\small\item\em random variable in condition \item\end{CompactList}\item 
111\hypertarget{classmpdf_7aa894208a32f3487827df6d5054424c}{
112\hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classmpdf_7aa894208a32f3487827df6d5054424c}{ep}}
113\label{classmpdf_7aa894208a32f3487827df6d5054424c}
114
115\begin{CompactList}\small\item\em pointer to internal \hyperlink{classepdf}{epdf} \item\end{CompactList}\end{CompactItemize}
116
117
118\subsection{Detailed Description}
119Class representing ratio of two densities which arise e.g. by applying the Bayes rule. It represents density in the form: \[ f(rv|rvc) = \frac{f(rv,rvc)}{f(rvc)} \] where $ f(rvc) = \int f(rv,rvc) d\ rv $.
120
121In particular this type of arise by conditioning of a mixture model.
122
123At present the only supported operation is \hyperlink{classmratio_9fb0df09a2e975e8b9f7ce41ecd65a09}{evallogcond()}.
124
125\subsection{Constructor \& Destructor Documentation}
126\hypertarget{classmratio_c2452f4fc3046cfe8f2453deb343b3ac}{
127\index{mratio@{mratio}!mratio@{mratio}}
128\index{mratio@{mratio}!mratio@{mratio}}
129\subsubsection[mratio]{\setlength{\rightskip}{0pt plus 5cm}mratio::mratio (const {\bf epdf} $\ast$ {\em nom0}, \/  const {\bf RV} \& {\em rv}, \/  bool {\em copy} = {\tt false})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
130\label{classmratio_c2452f4fc3046cfe8f2453deb343b3ac}
131
132
133Default constructor. By default, the given \hyperlink{classepdf}{epdf} is not copied! It is assumed that this function will be used only temporarily.
134
135References den, destroynom, RV::length(), epdf::marginal(), nom, and mpdf::rvc.
136
137\subsection{Member Function Documentation}
138\hypertarget{classmpdf_3f172b79ec4a5ebc87898a5381141f1b}{
139\index{mratio@{mratio}!samplecond@{samplecond}}
140\index{samplecond@{samplecond}!mratio@{mratio}}
141\subsubsection[samplecond]{\setlength{\rightskip}{0pt plus 5cm}virtual vec mpdf::samplecond (const vec \& {\em cond}, \/  double \& {\em ll})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual, inherited\mbox{]}}}}
142\label{classmpdf_3f172b79ec4a5ebc87898a5381141f1b}
143
144
145Returns a sample from the density conditioned on {\tt cond}, $x \sim epdf(rv|cond)$.
146
147\begin{Desc}
148\item[Parameters:]
149\begin{description}
150\item[{\em cond}]is numeric value of {\tt rv} \item[{\em ll}]is a return value of log-likelihood of the sample. \end{description}
151\end{Desc}
152
153
154Reimplemented in \hyperlink{classmprod_a48887eb8738a9e5550bfc38eb8e9d68}{mprod}.
155
156References mpdf::condition(), mpdf::ep, epdf::evallog(), and epdf::sample().
157
158Referenced by MPF$<$ BM\_\-T $>$::bayes(), and PF::bayes().\hypertarget{classmpdf_b1dae6171ee39a6a05976c7b1007a3c5}{
159\index{mratio@{mratio}!samplecond\_\-m@{samplecond\_\-m}}
160\index{samplecond\_\-m@{samplecond\_\-m}!mratio@{mratio}}
161\subsubsection[samplecond\_\-m]{\setlength{\rightskip}{0pt plus 5cm}virtual mat mpdf::samplecond\_\-m (const vec \& {\em cond}, \/  vec \& {\em ll}, \/  int {\em N})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual, inherited\mbox{]}}}}
162\label{classmpdf_b1dae6171ee39a6a05976c7b1007a3c5}
163
164
165Returns.
166
167\begin{Desc}
168\item[Parameters:]
169\begin{description}
170\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}
171\end{Desc}
172
173
174References mpdf::condition(), RV::count(), mpdf::ep, epdf::evallog(), mpdf::rv, and epdf::sample().
175
176The documentation for this class was generated from the following file:\begin{CompactItemize}
177\item 
178work/git/mixpp/bdm/stat/\hyperlink{emix_8h}{emix.h}\end{CompactItemize}
Note: See TracBrowser for help on using the browser.