1 | \hypertarget{classeigamma}{ |
---|
2 | \section{eigamma Class Reference} |
---|
3 | \label{classeigamma}\index{eigamma@{eigamma}} |
---|
4 | } |
---|
5 | Inverse-Gamma posterior density. |
---|
6 | |
---|
7 | |
---|
8 | {\tt \#include $<$libEF.h$>$} |
---|
9 | |
---|
10 | Inheritance diagram for eigamma:\nopagebreak |
---|
11 | \begin{figure}[H] |
---|
12 | \begin{center} |
---|
13 | \leavevmode |
---|
14 | \includegraphics[width=53pt]{classeigamma__inherit__graph} |
---|
15 | \end{center} |
---|
16 | \end{figure} |
---|
17 | Collaboration diagram for eigamma:\nopagebreak |
---|
18 | \begin{figure}[H] |
---|
19 | \begin{center} |
---|
20 | \leavevmode |
---|
21 | \includegraphics[width=70pt]{classeigamma__coll__graph} |
---|
22 | \end{center} |
---|
23 | \end{figure} |
---|
24 | \subsection*{Public Member Functions} |
---|
25 | \begin{CompactItemize} |
---|
26 | \item |
---|
27 | \hypertarget{classeigamma_ea0edc0a1f32350219f55cf35d83a5f6}{ |
---|
28 | \hyperlink{classeigamma_ea0edc0a1f32350219f55cf35d83a5f6}{eigamma} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv})} |
---|
29 | \label{classeigamma_ea0edc0a1f32350219f55cf35d83a5f6} |
---|
30 | |
---|
31 | \begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item |
---|
32 | \hypertarget{classeigamma_a86b94a5f9189cae1b6651838dc153aa}{ |
---|
33 | void \hyperlink{classeigamma_a86b94a5f9189cae1b6651838dc153aa}{set\_\-parameters} (const vec \&a, const vec \&b)} |
---|
34 | \label{classeigamma_a86b94a5f9189cae1b6651838dc153aa} |
---|
35 | |
---|
36 | \begin{CompactList}\small\item\em Sets parameters. \item\end{CompactList}\item |
---|
37 | \hypertarget{classeigamma_b70deffdf41b590377fd6743e4d306f1}{ |
---|
38 | vec \hyperlink{classeigamma_b70deffdf41b590377fd6743e4d306f1}{sample} () const } |
---|
39 | \label{classeigamma_b70deffdf41b590377fd6743e4d306f1} |
---|
40 | |
---|
41 | \begin{CompactList}\small\item\em Returns a sample, $x$ from density $epdf(rv)$. \item\end{CompactList}\item |
---|
42 | \hypertarget{classeigamma_960cf366101389f58f11c5f748dd7e80}{ |
---|
43 | double \hyperlink{classeigamma_960cf366101389f58f11c5f748dd7e80}{evallog} (const vec \&val) const } |
---|
44 | \label{classeigamma_960cf366101389f58f11c5f748dd7e80} |
---|
45 | |
---|
46 | \begin{CompactList}\small\item\em TODO: is it used anywhere? \item\end{CompactList}\item |
---|
47 | \hypertarget{classeigamma_efcc280de487d8b81f9b31f286404c72}{ |
---|
48 | double \hyperlink{classeigamma_efcc280de487d8b81f9b31f286404c72}{lognc} () const } |
---|
49 | \label{classeigamma_efcc280de487d8b81f9b31f286404c72} |
---|
50 | |
---|
51 | \begin{CompactList}\small\item\em logarithm of the normalizing constant, $\mathcal{I}$ \item\end{CompactList}\item |
---|
52 | \hypertarget{classeigamma_86389685695f6948d2e52070cd89a9ed}{ |
---|
53 | void \hyperlink{classeigamma_86389685695f6948d2e52070cd89a9ed}{\_\-param} (vec $\ast$\&a, vec $\ast$\&b)} |
---|
54 | \label{classeigamma_86389685695f6948d2e52070cd89a9ed} |
---|
55 | |
---|
56 | \begin{CompactList}\small\item\em Returns poiter to alpha and beta. Potentially dangerous: use with care! \item\end{CompactList}\item |
---|
57 | \hypertarget{classeigamma_0ff10e82b0f0d07c2dd4ff5f23b3c70f}{ |
---|
58 | vec \hyperlink{classeigamma_0ff10e82b0f0d07c2dd4ff5f23b3c70f}{mean} () const } |
---|
59 | \label{classeigamma_0ff10e82b0f0d07c2dd4ff5f23b3c70f} |
---|
60 | |
---|
61 | \begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item |
---|
62 | \hypertarget{classeigamma_a9ad6cb7514ffc46605f28316eda54ff}{ |
---|
63 | vec \hyperlink{classeigamma_a9ad6cb7514ffc46605f28316eda54ff}{variance} () const } |
---|
64 | \label{classeigamma_a9ad6cb7514ffc46605f28316eda54ff} |
---|
65 | |
---|
66 | \begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\item |
---|
67 | \hypertarget{classeEF_a89bef8996410609004fa019b5b48964}{ |
---|
68 | virtual void \hyperlink{classeEF_a89bef8996410609004fa019b5b48964}{dupdate} (mat \&v)} |
---|
69 | \label{classeEF_a89bef8996410609004fa019b5b48964} |
---|
70 | |
---|
71 | \begin{CompactList}\small\item\em TODO decide if it is really needed. \item\end{CompactList}\item |
---|
72 | \hypertarget{classeEF_41c70565b4d3fb424599817d008f0c71}{ |
---|
73 | virtual double \hyperlink{classeEF_41c70565b4d3fb424599817d008f0c71}{evallog\_\-nn} (const vec \&val) const } |
---|
74 | \label{classeEF_41c70565b4d3fb424599817d008f0c71} |
---|
75 | |
---|
76 | \begin{CompactList}\small\item\em Evaluate normalized log-probability. \item\end{CompactList}\item |
---|
77 | \hypertarget{classeEF_cff03a658aec11b806c3e3d48f37b81f}{ |
---|
78 | virtual vec \hyperlink{classeEF_cff03a658aec11b806c3e3d48f37b81f}{evallog} (const mat \&Val) const } |
---|
79 | \label{classeEF_cff03a658aec11b806c3e3d48f37b81f} |
---|
80 | |
---|
81 | \begin{CompactList}\small\item\em Evaluate normalized log-probability for many samples. \item\end{CompactList}\item |
---|
82 | \hypertarget{classeEF_4f8385dd1cc9740522dc373b1dc3cbf5}{ |
---|
83 | virtual void \hyperlink{classeEF_4f8385dd1cc9740522dc373b1dc3cbf5}{pow} (double p)} |
---|
84 | \label{classeEF_4f8385dd1cc9740522dc373b1dc3cbf5} |
---|
85 | |
---|
86 | \begin{CompactList}\small\item\em Power of the density, used e.g. to flatten the density. \item\end{CompactList}\item |
---|
87 | \hypertarget{classepdf_76608914c3b19e150292d5c56e93e508}{ |
---|
88 | virtual mat \hyperlink{classepdf_76608914c3b19e150292d5c56e93e508}{sample\_\-m} (int N) const } |
---|
89 | \label{classepdf_76608914c3b19e150292d5c56e93e508} |
---|
90 | |
---|
91 | \begin{CompactList}\small\item\em Returns N samples from density $epdf(rv)$. \item\end{CompactList}\item |
---|
92 | \hypertarget{classepdf_2495a04bbacb9b55fe5a3a59b78affca}{ |
---|
93 | virtual vec \hyperlink{classepdf_2495a04bbacb9b55fe5a3a59b78affca}{evallog\_\-m} (const mat \&Val) const } |
---|
94 | \label{classepdf_2495a04bbacb9b55fe5a3a59b78affca} |
---|
95 | |
---|
96 | \begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item |
---|
97 | \hypertarget{classepdf_e87dc8260a5c37bc1b03eb66174741a0}{ |
---|
98 | virtual \hyperlink{classmpdf}{mpdf} $\ast$ \hyperlink{classepdf_e87dc8260a5c37bc1b03eb66174741a0}{condition} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const } |
---|
99 | \label{classepdf_e87dc8260a5c37bc1b03eb66174741a0} |
---|
100 | |
---|
101 | \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 |
---|
102 | \hypertarget{classepdf_38de9f59b65ee06028554f3f74b66025}{ |
---|
103 | virtual \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classepdf_38de9f59b65ee06028554f3f74b66025}{marginal} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const } |
---|
104 | \label{classepdf_38de9f59b65ee06028554f3f74b66025} |
---|
105 | |
---|
106 | \begin{CompactList}\small\item\em Return marginal density on the given \hyperlink{classRV}{RV}, the remainig rvs are intergrated out. \item\end{CompactList}\item |
---|
107 | \hypertarget{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{ |
---|
108 | const \hyperlink{classRV}{RV} \& \hyperlink{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{\_\-rv} () const } |
---|
109 | \label{classepdf_ca0d32aabb4cbba347e0c37fe8607562} |
---|
110 | |
---|
111 | \begin{CompactList}\small\item\em access function, possibly dangerous! \item\end{CompactList}\item |
---|
112 | \hypertarget{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{ |
---|
113 | void \hyperlink{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{\_\-renewrv} (const \hyperlink{classRV}{RV} \&in\_\-rv)} |
---|
114 | \label{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5} |
---|
115 | |
---|
116 | \begin{CompactList}\small\item\em modifier function - useful when copying epdfs \item\end{CompactList}\end{CompactItemize} |
---|
117 | \subsection*{Protected Attributes} |
---|
118 | \begin{CompactItemize} |
---|
119 | \item |
---|
120 | \hypertarget{classeigamma_ea00e33f405ebd918e06cede968a735b}{ |
---|
121 | vec $\ast$ \hyperlink{classeigamma_ea00e33f405ebd918e06cede968a735b}{alpha}} |
---|
122 | \label{classeigamma_ea00e33f405ebd918e06cede968a735b} |
---|
123 | |
---|
124 | \begin{CompactList}\small\item\em Vector $\alpha$. \item\end{CompactList}\item |
---|
125 | \hypertarget{classeigamma_ee446ec667a4df391e0db41decb2d558}{ |
---|
126 | vec $\ast$ \hyperlink{classeigamma_ee446ec667a4df391e0db41decb2d558}{beta}} |
---|
127 | \label{classeigamma_ee446ec667a4df391e0db41decb2d558} |
---|
128 | |
---|
129 | \begin{CompactList}\small\item\em Vector $\beta$ (in fact it is 1/beta as used in definition of iG). \item\end{CompactList}\item |
---|
130 | \hypertarget{classeigamma_906f2a3a8fbf08b2af49776f2f1be5d4}{ |
---|
131 | \hyperlink{classegamma}{egamma} \hyperlink{classeigamma_906f2a3a8fbf08b2af49776f2f1be5d4}{eg}} |
---|
132 | \label{classeigamma_906f2a3a8fbf08b2af49776f2f1be5d4} |
---|
133 | |
---|
134 | \begin{CompactList}\small\item\em internal \hyperlink{classegamma}{egamma} \item\end{CompactList}\item |
---|
135 | \hypertarget{classepdf_74da992e3f5d598da8850b646b79b9d9}{ |
---|
136 | \hyperlink{classRV}{RV} \hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}} |
---|
137 | \label{classepdf_74da992e3f5d598da8850b646b79b9d9} |
---|
138 | |
---|
139 | \begin{CompactList}\small\item\em Identified of the random variable. \item\end{CompactList}\end{CompactItemize} |
---|
140 | |
---|
141 | |
---|
142 | \subsection{Detailed Description} |
---|
143 | Inverse-Gamma posterior density. |
---|
144 | |
---|
145 | Multivariate inverse-Gamma density as product of independent univariate densities. \[ f(x|\alpha,\beta) = \prod f(x_i|\alpha_i,\beta_i) \] |
---|
146 | |
---|
147 | Inverse Gamma can be converted to Gamma using $\backslash$\mbox{[} x iG(a,b) =$>$ 1/x G(a,1/b) $\backslash$\mbox{]} This relation is used in sampling. |
---|
148 | |
---|
149 | The documentation for this class was generated from the following file:\begin{CompactItemize} |
---|
150 | \item |
---|
151 | work/git/mixpp/bdm/stat/\hyperlink{libEF_8h}{libEF.h}\end{CompactItemize} |
---|