1 | \hypertarget{classemix}{ |
---|
2 | \section{emix Class Reference} |
---|
3 | \label{classemix}\index{emix@{emix}} |
---|
4 | } |
---|
5 | Mixture of epdfs. |
---|
6 | |
---|
7 | |
---|
8 | {\tt \#include $<$emix.h$>$} |
---|
9 | |
---|
10 | Inheritance diagram for emix:\nopagebreak |
---|
11 | \begin{figure}[H] |
---|
12 | \begin{center} |
---|
13 | \leavevmode |
---|
14 | \includegraphics[width=40pt]{classemix__inherit__graph} |
---|
15 | \end{center} |
---|
16 | \end{figure} |
---|
17 | Collaboration diagram for emix:\nopagebreak |
---|
18 | \begin{figure}[H] |
---|
19 | \begin{center} |
---|
20 | \leavevmode |
---|
21 | \includegraphics[width=40pt]{classemix__coll__graph} |
---|
22 | \end{center} |
---|
23 | \end{figure} |
---|
24 | \subsection*{Public Member Functions} |
---|
25 | \begin{CompactItemize} |
---|
26 | \item |
---|
27 | \hypertarget{classemix_62194619791d5f1da88cad01cfc9339d}{ |
---|
28 | \hyperlink{classemix_62194619791d5f1da88cad01cfc9339d}{emix} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv})} |
---|
29 | \label{classemix_62194619791d5f1da88cad01cfc9339d} |
---|
30 | |
---|
31 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
32 | void \hyperlink{classemix_d3789d50a3327a6de552db077af5e4c5}{set\_\-parameters} (const vec \&\hyperlink{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab}{w}, const Array$<$ \hyperlink{classepdf}{epdf} $\ast$ $>$ \&\hyperlink{classemix_7155d827417b53fb6aa5cff1459e6eb4}{Coms}, bool copy=true) |
---|
33 | \item |
---|
34 | \hypertarget{classemix_0650601f24e633e0ab09aa1e46c14483}{ |
---|
35 | vec \hyperlink{classemix_0650601f24e633e0ab09aa1e46c14483}{sample} () const } |
---|
36 | \label{classemix_0650601f24e633e0ab09aa1e46c14483} |
---|
37 | |
---|
38 | \begin{CompactList}\small\item\em Returns a sample, $x$ from density $epdf(rv)$. \item\end{CompactList}\item |
---|
39 | \hypertarget{classemix_b662a51d042b062020460e64bff4e9e8}{ |
---|
40 | vec \hyperlink{classemix_b662a51d042b062020460e64bff4e9e8}{mean} () const } |
---|
41 | \label{classemix_b662a51d042b062020460e64bff4e9e8} |
---|
42 | |
---|
43 | \begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item |
---|
44 | \hypertarget{classemix_73b96c9989b398c2a16417a70773442e}{ |
---|
45 | vec \hyperlink{classemix_73b96c9989b398c2a16417a70773442e}{variance} () const } |
---|
46 | \label{classemix_73b96c9989b398c2a16417a70773442e} |
---|
47 | |
---|
48 | \begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\item |
---|
49 | \hypertarget{classemix_82691a72b583dab957cbd60d9283e47a}{ |
---|
50 | double \hyperlink{classemix_82691a72b583dab957cbd60d9283e47a}{evallog} (const vec \&val) const } |
---|
51 | \label{classemix_82691a72b583dab957cbd60d9283e47a} |
---|
52 | |
---|
53 | \begin{CompactList}\small\item\em Compute log-probability of argument {\tt val}. \item\end{CompactList}\item |
---|
54 | \hypertarget{classemix_b3eb9e153e8bfdb6bb47adecc278cbca}{ |
---|
55 | vec \hyperlink{classemix_b3eb9e153e8bfdb6bb47adecc278cbca}{evallog\_\-m} (const mat \&Val) const } |
---|
56 | \label{classemix_b3eb9e153e8bfdb6bb47adecc278cbca} |
---|
57 | |
---|
58 | \begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item |
---|
59 | \hypertarget{classemix_44ae2b86c650c2ccb967969c1859d268}{ |
---|
60 | mat \hyperlink{classemix_44ae2b86c650c2ccb967969c1859d268}{evallog\_\-M} (const mat \&Val) const } |
---|
61 | \label{classemix_44ae2b86c650c2ccb967969c1859d268} |
---|
62 | |
---|
63 | \begin{CompactList}\small\item\em Auxiliary function that returns pdflog for each component. \item\end{CompactList}\item |
---|
64 | \hypertarget{classemix_33afde698093d458ce71875f7ee7384a}{ |
---|
65 | \hyperlink{classemix}{emix} $\ast$ \hyperlink{classemix_33afde698093d458ce71875f7ee7384a}{marginal} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const } |
---|
66 | \label{classemix_33afde698093d458ce71875f7ee7384a} |
---|
67 | |
---|
68 | \begin{CompactList}\small\item\em Return marginal density on the given \hyperlink{classRV}{RV}, the remainig rvs are intergrated out. \item\end{CompactList}\item |
---|
69 | \hypertarget{classemix_ebf50c387034f72040c83d38738549b3}{ |
---|
70 | \hyperlink{classmratio}{mratio} $\ast$ \hyperlink{classemix_ebf50c387034f72040c83d38738549b3}{condition} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const } |
---|
71 | \label{classemix_ebf50c387034f72040c83d38738549b3} |
---|
72 | |
---|
73 | \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 |
---|
74 | \hypertarget{classemix_35baf0f62307455cebfbf462144b4dd8}{ |
---|
75 | vec \& \hyperlink{classemix_35baf0f62307455cebfbf462144b4dd8}{\_\-w} ()} |
---|
76 | \label{classemix_35baf0f62307455cebfbf462144b4dd8} |
---|
77 | |
---|
78 | \begin{CompactList}\small\item\em returns a pointer to the internal mean value. Use with Care! \item\end{CompactList}\item |
---|
79 | \hypertarget{classemix_4d7baeb2a9e3fca1d8fd32a107df291d}{ |
---|
80 | void \hyperlink{classemix_4d7baeb2a9e3fca1d8fd32a107df291d}{ownComs} ()} |
---|
81 | \label{classemix_4d7baeb2a9e3fca1d8fd32a107df291d} |
---|
82 | |
---|
83 | \begin{CompactList}\small\item\em Auxiliary function for taking ownership of the \hyperlink{classemix_7155d827417b53fb6aa5cff1459e6eb4}{Coms()}. \item\end{CompactList}\item |
---|
84 | \hypertarget{classemix_95d175b2daa1d896ceffd69b70e02efb}{ |
---|
85 | \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classemix_95d175b2daa1d896ceffd69b70e02efb}{\_\-Coms} (int i)} |
---|
86 | \label{classemix_95d175b2daa1d896ceffd69b70e02efb} |
---|
87 | |
---|
88 | \begin{CompactList}\small\item\em access function \item\end{CompactList}\item |
---|
89 | \hypertarget{classepdf_76608914c3b19e150292d5c56e93e508}{ |
---|
90 | virtual mat \hyperlink{classepdf_76608914c3b19e150292d5c56e93e508}{sample\_\-m} (int N) const } |
---|
91 | \label{classepdf_76608914c3b19e150292d5c56e93e508} |
---|
92 | |
---|
93 | \begin{CompactList}\small\item\em Returns N samples from density $epdf(rv)$. \item\end{CompactList}\item |
---|
94 | \hypertarget{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{ |
---|
95 | const \hyperlink{classRV}{RV} \& \hyperlink{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{\_\-rv} () const } |
---|
96 | \label{classepdf_ca0d32aabb4cbba347e0c37fe8607562} |
---|
97 | |
---|
98 | \begin{CompactList}\small\item\em access function, possibly dangerous! \item\end{CompactList}\item |
---|
99 | \hypertarget{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{ |
---|
100 | void \hyperlink{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{\_\-renewrv} (const \hyperlink{classRV}{RV} \&in\_\-rv)} |
---|
101 | \label{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5} |
---|
102 | |
---|
103 | \begin{CompactList}\small\item\em modifier function - useful when copying epdfs \item\end{CompactList}\end{CompactItemize} |
---|
104 | \subsection*{Protected Attributes} |
---|
105 | \begin{CompactItemize} |
---|
106 | \item |
---|
107 | \hypertarget{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab}{ |
---|
108 | vec \hyperlink{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab}{w}} |
---|
109 | \label{classemix_cdc8f4e2a5e43595ac5450d8a7f9d1ab} |
---|
110 | |
---|
111 | \begin{CompactList}\small\item\em weights of the components \item\end{CompactList}\item |
---|
112 | \hypertarget{classemix_7155d827417b53fb6aa5cff1459e6eb4}{ |
---|
113 | Array$<$ \hyperlink{classepdf}{epdf} $\ast$ $>$ \hyperlink{classemix_7155d827417b53fb6aa5cff1459e6eb4}{Coms}} |
---|
114 | \label{classemix_7155d827417b53fb6aa5cff1459e6eb4} |
---|
115 | |
---|
116 | \begin{CompactList}\small\item\em Component (epdfs). \item\end{CompactList}\item |
---|
117 | \hypertarget{classemix_7d0d863e6066ee02947914ff06ac34e8}{ |
---|
118 | bool \hyperlink{classemix_7d0d863e6066ee02947914ff06ac34e8}{destroyComs}} |
---|
119 | \label{classemix_7d0d863e6066ee02947914ff06ac34e8} |
---|
120 | |
---|
121 | \begin{CompactList}\small\item\em Flag if owning Coms. \item\end{CompactList}\item |
---|
122 | \hypertarget{classepdf_74da992e3f5d598da8850b646b79b9d9}{ |
---|
123 | \hyperlink{classRV}{RV} \hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}} |
---|
124 | \label{classepdf_74da992e3f5d598da8850b646b79b9d9} |
---|
125 | |
---|
126 | \begin{CompactList}\small\item\em Identified of the random variable. \item\end{CompactList}\end{CompactItemize} |
---|
127 | |
---|
128 | |
---|
129 | \subsection{Detailed Description} |
---|
130 | Mixture of epdfs. |
---|
131 | |
---|
132 | Density function: \[ f(x) = \sum_{i=1}^{n} w_{i} f_i(x), \quad \sum_{i=1}^n w_i = 1. \] where $f_i(x)$ is any density on random variable $x$, called {\em component\/}, |
---|
133 | |
---|
134 | \subsection{Member Function Documentation} |
---|
135 | \hypertarget{classemix_d3789d50a3327a6de552db077af5e4c5}{ |
---|
136 | \index{emix@{emix}!set\_\-parameters@{set\_\-parameters}} |
---|
137 | \index{set\_\-parameters@{set\_\-parameters}!emix@{emix}} |
---|
138 | \subsubsection[set\_\-parameters]{\setlength{\rightskip}{0pt plus 5cm}void emix::set\_\-parameters (const vec \& {\em w}, \/ const Array$<$ {\bf epdf} $\ast$ $>$ \& {\em Coms}, \/ bool {\em copy} = {\tt true})}} |
---|
139 | \label{classemix_d3789d50a3327a6de552db077af5e4c5} |
---|
140 | |
---|
141 | |
---|
142 | Set weights {\tt w} and components {\tt Coms} By default Coms are copied inside. Parameter {\tt copy} can be set to false if Coms live externally. Use method \hyperlink{classemix_4d7baeb2a9e3fca1d8fd32a107df291d}{ownComs()} if Coms should be destroyed by the destructor. |
---|
143 | |
---|
144 | References epdf::\_\-rv(), Coms, destroyComs, RV::equal(), epdf::rv, and w. |
---|
145 | |
---|
146 | Referenced by marginal(), MixEF::predictor(), and mmix::set\_\-parameters(). |
---|
147 | |
---|
148 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
149 | \item |
---|
150 | work/git/mixpp/bdm/stat/\hyperlink{emix_8h}{emix.h}\item |
---|
151 | work/git/mixpp/bdm/stat/emix.cpp\end{CompactItemize} |
---|