1 | \hypertarget{classbdm_1_1mratio}{ |
---|
2 | \section{bdm::mratio Class Reference} |
---|
3 | \label{classbdm_1_1mratio}\index{bdm::mratio@{bdm::mratio}} |
---|
4 | } |
---|
5 | Class 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 | |
---|
10 | Inheritance diagram for bdm::mratio:\nopagebreak |
---|
11 | \begin{figure}[H] |
---|
12 | \begin{center} |
---|
13 | \leavevmode |
---|
14 | \includegraphics[width=64pt]{classbdm_1_1mratio__inherit__graph} |
---|
15 | \end{center} |
---|
16 | \end{figure} |
---|
17 | Collaboration diagram for bdm::mratio:\nopagebreak |
---|
18 | \begin{figure}[H] |
---|
19 | \begin{center} |
---|
20 | \leavevmode |
---|
21 | \includegraphics[width=148pt]{classbdm_1_1mratio__coll__graph} |
---|
22 | \end{center} |
---|
23 | \end{figure} |
---|
24 | \subsection*{Public Member Functions} |
---|
25 | \begin{CompactItemize} |
---|
26 | \item |
---|
27 | \hyperlink{classbdm_1_1mratio_0ff56d13f9515d7e5f23b7a4cc5529b4}{mratio} (const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$nom0, const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1mpdf_9bcfb45435d30983f436d41c298cbb51}{rv}, bool copy=false) |
---|
28 | \item |
---|
29 | \hypertarget{classbdm_1_1mratio_3a2cbce8c61ca9f592d9c2220f7c1204}{ |
---|
30 | double \hyperlink{classbdm_1_1mratio_3a2cbce8c61ca9f592d9c2220f7c1204}{evallogcond} (const vec \&val, const vec \&cond)} |
---|
31 | \label{classbdm_1_1mratio_3a2cbce8c61ca9f592d9c2220f7c1204} |
---|
32 | |
---|
33 | \begin{CompactList}\small\item\em Shortcut for conditioning and evaluation of the internal \hyperlink{classbdm_1_1epdf}{epdf}. In some cases, this operation can be implemented efficiently. \item\end{CompactList}\item |
---|
34 | \hypertarget{classbdm_1_1mratio_c8b39fea586d4258bb3c881406edaf15}{ |
---|
35 | void \hyperlink{classbdm_1_1mratio_c8b39fea586d4258bb3c881406edaf15}{ownnom} ()} |
---|
36 | \label{classbdm_1_1mratio_c8b39fea586d4258bb3c881406edaf15} |
---|
37 | |
---|
38 | \begin{CompactList}\small\item\em Object takes ownership of nom and will destroy it. \item\end{CompactList}\item |
---|
39 | \hypertarget{classbdm_1_1mratio_c0cc0b25dbdc54751466616655454c5c}{ |
---|
40 | \hyperlink{classbdm_1_1mratio_c0cc0b25dbdc54751466616655454c5c}{$\sim$mratio} ()} |
---|
41 | \label{classbdm_1_1mratio_c0cc0b25dbdc54751466616655454c5c} |
---|
42 | |
---|
43 | \begin{CompactList}\small\item\em Default destructor. \item\end{CompactList}\item |
---|
44 | virtual vec \hyperlink{classbdm_1_1mpdf_e4848a428d8ef0549c6e4a9ed386d9f2}{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 |
---|
46 | virtual mat \hyperlink{classbdm_1_1mpdf_ee26963a637b2ea1fb1933652981e652}{samplecond\_\-m} (const vec \&cond, vec \&ll, int N) |
---|
47 | \begin{CompactList}\small\item\em Returns. \item\end{CompactList}\item |
---|
48 | \hypertarget{classbdm_1_1mpdf_db94784a9aacf74c65c5a014f6743530}{ |
---|
49 | virtual void \hyperlink{classbdm_1_1mpdf_db94784a9aacf74c65c5a014f6743530}{condition} (const vec \&cond)} |
---|
50 | \label{classbdm_1_1mpdf_db94784a9aacf74c65c5a014f6743530} |
---|
51 | |
---|
52 | \begin{CompactList}\small\item\em Update {\tt ep} so that it represents this \hyperlink{classbdm_1_1mpdf}{mpdf} conditioned on {\tt rvc} = cond. \item\end{CompactList}\item |
---|
53 | \hypertarget{classbdm_1_1mpdf_0b0ed1ed663071bb7cf4a1349eb94fcb}{ |
---|
54 | virtual vec \hyperlink{classbdm_1_1mpdf_0b0ed1ed663071bb7cf4a1349eb94fcb}{evallogcond\_\-m} (const mat \&Dt, const vec \&cond)} |
---|
55 | \label{classbdm_1_1mpdf_0b0ed1ed663071bb7cf4a1349eb94fcb} |
---|
56 | |
---|
57 | \begin{CompactList}\small\item\em Matrix version of evallogcond. \item\end{CompactList}\item |
---|
58 | \hypertarget{classbdm_1_1mpdf_b3aba7311038bf990d706a64cab60cf8}{ |
---|
59 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1mpdf_b3aba7311038bf990d706a64cab60cf8}{\_\-rvc} () const } |
---|
60 | \label{classbdm_1_1mpdf_b3aba7311038bf990d706a64cab60cf8} |
---|
61 | |
---|
62 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
63 | \hypertarget{classbdm_1_1mpdf_222d5280e309c5a053ba73841e98c151}{ |
---|
64 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1mpdf_222d5280e309c5a053ba73841e98c151}{\_\-rv} () const } |
---|
65 | \label{classbdm_1_1mpdf_222d5280e309c5a053ba73841e98c151} |
---|
66 | |
---|
67 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
68 | \hypertarget{classbdm_1_1mpdf_1892fe3933488942253679f068e9e7f6}{ |
---|
69 | \hyperlink{classbdm_1_1epdf}{epdf} \& \hyperlink{classbdm_1_1mpdf_1892fe3933488942253679f068e9e7f6}{\_\-epdf} ()} |
---|
70 | \label{classbdm_1_1mpdf_1892fe3933488942253679f068e9e7f6} |
---|
71 | |
---|
72 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
73 | \hypertarget{classbdm_1_1mpdf_05e843fd11c410a99dad2b88c55aca80}{ |
---|
74 | \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1mpdf_05e843fd11c410a99dad2b88c55aca80}{\_\-e} ()} |
---|
75 | \label{classbdm_1_1mpdf_05e843fd11c410a99dad2b88c55aca80} |
---|
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{classbdm_1_1mratio_f31caba90a2aa10fbf7631832404fe54}{ |
---|
82 | const \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1mratio_f31caba90a2aa10fbf7631832404fe54}{nom}} |
---|
83 | \label{classbdm_1_1mratio_f31caba90a2aa10fbf7631832404fe54} |
---|
84 | |
---|
85 | \begin{CompactList}\small\item\em Nominator in the form of \hyperlink{classbdm_1_1mpdf}{mpdf}. \item\end{CompactList}\item |
---|
86 | \hypertarget{classbdm_1_1mratio_7daa5d02d3a3be9d15fd4156d886ed88}{ |
---|
87 | \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1mratio_7daa5d02d3a3be9d15fd4156d886ed88}{den}} |
---|
88 | \label{classbdm_1_1mratio_7daa5d02d3a3be9d15fd4156d886ed88} |
---|
89 | |
---|
90 | \begin{CompactList}\small\item\em Denominator in the form of \hyperlink{classbdm_1_1epdf}{epdf}. \item\end{CompactList}\item |
---|
91 | \hypertarget{classbdm_1_1mratio_51bfe6675e724f7fbeaaeacce5a9f9b8}{ |
---|
92 | bool \hyperlink{classbdm_1_1mratio_51bfe6675e724f7fbeaaeacce5a9f9b8}{destroynom}} |
---|
93 | \label{classbdm_1_1mratio_51bfe6675e724f7fbeaaeacce5a9f9b8} |
---|
94 | |
---|
95 | \begin{CompactList}\small\item\em flag for destructor \item\end{CompactList}\item |
---|
96 | \hypertarget{classbdm_1_1mratio_cda5bd23ba60146d69e1f804ff7710c7}{ |
---|
97 | \hyperlink{classbdm_1_1datalink__m2e}{datalink\_\-m2e} \hyperlink{classbdm_1_1mratio_cda5bd23ba60146d69e1f804ff7710c7}{dl}} |
---|
98 | \label{classbdm_1_1mratio_cda5bd23ba60146d69e1f804ff7710c7} |
---|
99 | |
---|
100 | \begin{CompactList}\small\item\em datalink between conditional and nom \item\end{CompactList}\item |
---|
101 | \hypertarget{classbdm_1_1mpdf_9bcfb45435d30983f436d41c298cbb51}{ |
---|
102 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1mpdf_9bcfb45435d30983f436d41c298cbb51}{rv}} |
---|
103 | \label{classbdm_1_1mpdf_9bcfb45435d30983f436d41c298cbb51} |
---|
104 | |
---|
105 | \begin{CompactList}\small\item\em modeled random variable \item\end{CompactList}\item |
---|
106 | \hypertarget{classbdm_1_1mpdf_5a5f08950daa08b85b01ddf4e1c36288}{ |
---|
107 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1mpdf_5a5f08950daa08b85b01ddf4e1c36288}{rvc}} |
---|
108 | \label{classbdm_1_1mpdf_5a5f08950daa08b85b01ddf4e1c36288} |
---|
109 | |
---|
110 | \begin{CompactList}\small\item\em random variable in condition \item\end{CompactList}\item |
---|
111 | \hypertarget{classbdm_1_1mpdf_5eea43c56d38e4441bfb30270db949c0}{ |
---|
112 | \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1mpdf_5eea43c56d38e4441bfb30270db949c0}{ep}} |
---|
113 | \label{classbdm_1_1mpdf_5eea43c56d38e4441bfb30270db949c0} |
---|
114 | |
---|
115 | \begin{CompactList}\small\item\em pointer to internal \hyperlink{classbdm_1_1epdf}{epdf} \item\end{CompactList}\end{CompactItemize} |
---|
116 | |
---|
117 | |
---|
118 | \subsection{Detailed Description} |
---|
119 | Class 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 | |
---|
121 | In particular this type of arise by conditioning of a mixture model. |
---|
122 | |
---|
123 | At present the only supported operation is \hyperlink{classbdm_1_1mratio_3a2cbce8c61ca9f592d9c2220f7c1204}{evallogcond()}. |
---|
124 | |
---|
125 | \subsection{Constructor \& Destructor Documentation} |
---|
126 | \hypertarget{classbdm_1_1mratio_0ff56d13f9515d7e5f23b7a4cc5529b4}{ |
---|
127 | \index{bdm::mratio@{bdm::mratio}!mratio@{mratio}} |
---|
128 | \index{mratio@{mratio}!bdm::mratio@{bdm::mratio}} |
---|
129 | \subsubsection[mratio]{\setlength{\rightskip}{0pt plus 5cm}bdm::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{classbdm_1_1mratio_0ff56d13f9515d7e5f23b7a4cc5529b4} |
---|
131 | |
---|
132 | |
---|
133 | Default constructor. By default, the given \hyperlink{classbdm_1_1epdf}{epdf} is not copied! It is assumed that this function will be used only temporarily. |
---|
134 | |
---|
135 | References den, destroynom, bdm::RV::length(), bdm::epdf::marginal(), nom, and bdm::mpdf::rvc. |
---|
136 | |
---|
137 | \subsection{Member Function Documentation} |
---|
138 | \hypertarget{classbdm_1_1mpdf_e4848a428d8ef0549c6e4a9ed386d9f2}{ |
---|
139 | \index{bdm::mratio@{bdm::mratio}!samplecond@{samplecond}} |
---|
140 | \index{samplecond@{samplecond}!bdm::mratio@{bdm::mratio}} |
---|
141 | \subsubsection[samplecond]{\setlength{\rightskip}{0pt plus 5cm}virtual vec bdm::mpdf::samplecond (const vec \& {\em cond}, \/ double \& {\em ll})\hspace{0.3cm}{\tt \mbox{[}inline, virtual, inherited\mbox{]}}}} |
---|
142 | \label{classbdm_1_1mpdf_e4848a428d8ef0549c6e4a9ed386d9f2} |
---|
143 | |
---|
144 | |
---|
145 | Returns 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 | |
---|
154 | Reimplemented in \hyperlink{classbdm_1_1mprod_1a37c2aaba8bde7fce5351c39b6e1168}{bdm::mprod}. |
---|
155 | |
---|
156 | References bdm::mpdf::condition(), bdm::mpdf::ep, bdm::epdf::evallog(), and bdm::epdf::sample(). |
---|
157 | |
---|
158 | Referenced by bdm::MPF$<$ BM\_\-T $>$::bayes(), bdm::PF::bayes(), and bdm::ArxDS::step().\hypertarget{classbdm_1_1mpdf_ee26963a637b2ea1fb1933652981e652}{ |
---|
159 | \index{bdm::mratio@{bdm::mratio}!samplecond\_\-m@{samplecond\_\-m}} |
---|
160 | \index{samplecond\_\-m@{samplecond\_\-m}!bdm::mratio@{bdm::mratio}} |
---|
161 | \subsubsection[samplecond\_\-m]{\setlength{\rightskip}{0pt plus 5cm}virtual mat bdm::mpdf::samplecond\_\-m (const vec \& {\em cond}, \/ vec \& {\em ll}, \/ int {\em N})\hspace{0.3cm}{\tt \mbox{[}inline, virtual, inherited\mbox{]}}}} |
---|
162 | \label{classbdm_1_1mpdf_ee26963a637b2ea1fb1933652981e652} |
---|
163 | |
---|
164 | |
---|
165 | Returns. |
---|
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 | |
---|
174 | References bdm::mpdf::condition(), bdm::RV::count(), bdm::mpdf::ep, bdm::epdf::evallog(), bdm::mpdf::rv, and bdm::epdf::sample(). |
---|
175 | |
---|
176 | The documentation for this class was generated from the following file:\begin{CompactItemize} |
---|
177 | \item |
---|
178 | \hyperlink{emix_8h}{emix.h}\end{CompactItemize} |
---|