\hypertarget{classeigamma}{
\section{eigamma Class Reference}
\label{classeigamma}\index{eigamma@{eigamma}}
}
Inverse-Gamma posterior density.  


{\tt \#include $<$libEF.h$>$}

Inheritance diagram for eigamma:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=53pt]{classeigamma__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for eigamma:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=70pt]{classeigamma__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classeigamma_ea0edc0a1f32350219f55cf35d83a5f6}{
\hyperlink{classeigamma_ea0edc0a1f32350219f55cf35d83a5f6}{eigamma} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv})}
\label{classeigamma_ea0edc0a1f32350219f55cf35d83a5f6}

\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
\hypertarget{classeigamma_a86b94a5f9189cae1b6651838dc153aa}{
void \hyperlink{classeigamma_a86b94a5f9189cae1b6651838dc153aa}{set\_\-parameters} (const vec \&a, const vec \&b)}
\label{classeigamma_a86b94a5f9189cae1b6651838dc153aa}

\begin{CompactList}\small\item\em Sets parameters. \item\end{CompactList}\item 
\hypertarget{classeigamma_b70deffdf41b590377fd6743e4d306f1}{
vec \hyperlink{classeigamma_b70deffdf41b590377fd6743e4d306f1}{sample} () const }
\label{classeigamma_b70deffdf41b590377fd6743e4d306f1}

\begin{CompactList}\small\item\em Returns a sample, $x$ from density $epdf(rv)$. \item\end{CompactList}\item 
\hypertarget{classeigamma_960cf366101389f58f11c5f748dd7e80}{
double \hyperlink{classeigamma_960cf366101389f58f11c5f748dd7e80}{evallog} (const vec \&val) const }
\label{classeigamma_960cf366101389f58f11c5f748dd7e80}

\begin{CompactList}\small\item\em TODO: is it used anywhere? \item\end{CompactList}\item 
\hypertarget{classeigamma_efcc280de487d8b81f9b31f286404c72}{
double \hyperlink{classeigamma_efcc280de487d8b81f9b31f286404c72}{lognc} () const }
\label{classeigamma_efcc280de487d8b81f9b31f286404c72}

\begin{CompactList}\small\item\em logarithm of the normalizing constant, $\mathcal{I}$ \item\end{CompactList}\item 
\hypertarget{classeigamma_86389685695f6948d2e52070cd89a9ed}{
void \hyperlink{classeigamma_86389685695f6948d2e52070cd89a9ed}{\_\-param} (vec $\ast$\&a, vec $\ast$\&b)}
\label{classeigamma_86389685695f6948d2e52070cd89a9ed}

\begin{CompactList}\small\item\em Returns poiter to alpha and beta. Potentially dangerous: use with care! \item\end{CompactList}\item 
\hypertarget{classeigamma_0ff10e82b0f0d07c2dd4ff5f23b3c70f}{
vec \hyperlink{classeigamma_0ff10e82b0f0d07c2dd4ff5f23b3c70f}{mean} () const }
\label{classeigamma_0ff10e82b0f0d07c2dd4ff5f23b3c70f}

\begin{CompactList}\small\item\em return expected value \item\end{CompactList}\item 
\hypertarget{classeigamma_a9ad6cb7514ffc46605f28316eda54ff}{
vec \hyperlink{classeigamma_a9ad6cb7514ffc46605f28316eda54ff}{variance} () const }
\label{classeigamma_a9ad6cb7514ffc46605f28316eda54ff}

\begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\item 
\hypertarget{classeEF_a89bef8996410609004fa019b5b48964}{
virtual void \hyperlink{classeEF_a89bef8996410609004fa019b5b48964}{dupdate} (mat \&v)}
\label{classeEF_a89bef8996410609004fa019b5b48964}

\begin{CompactList}\small\item\em TODO decide if it is really needed. \item\end{CompactList}\item 
\hypertarget{classeEF_41c70565b4d3fb424599817d008f0c71}{
virtual double \hyperlink{classeEF_41c70565b4d3fb424599817d008f0c71}{evallog\_\-nn} (const vec \&val) const }
\label{classeEF_41c70565b4d3fb424599817d008f0c71}

\begin{CompactList}\small\item\em Evaluate normalized log-probability. \item\end{CompactList}\item 
\hypertarget{classeEF_cff03a658aec11b806c3e3d48f37b81f}{
virtual vec \hyperlink{classeEF_cff03a658aec11b806c3e3d48f37b81f}{evallog} (const mat \&Val) const }
\label{classeEF_cff03a658aec11b806c3e3d48f37b81f}

\begin{CompactList}\small\item\em Evaluate normalized log-probability for many samples. \item\end{CompactList}\item 
\hypertarget{classeEF_4f8385dd1cc9740522dc373b1dc3cbf5}{
virtual void \hyperlink{classeEF_4f8385dd1cc9740522dc373b1dc3cbf5}{pow} (double p)}
\label{classeEF_4f8385dd1cc9740522dc373b1dc3cbf5}

\begin{CompactList}\small\item\em Power of the density, used e.g. to flatten the density. \item\end{CompactList}\item 
\hypertarget{classepdf_76608914c3b19e150292d5c56e93e508}{
virtual mat \hyperlink{classepdf_76608914c3b19e150292d5c56e93e508}{sample\_\-m} (int N) const }
\label{classepdf_76608914c3b19e150292d5c56e93e508}

\begin{CompactList}\small\item\em Returns N samples from density $epdf(rv)$. \item\end{CompactList}\item 
\hypertarget{classepdf_2495a04bbacb9b55fe5a3a59b78affca}{
virtual vec \hyperlink{classepdf_2495a04bbacb9b55fe5a3a59b78affca}{evallog\_\-m} (const mat \&Val) const }
\label{classepdf_2495a04bbacb9b55fe5a3a59b78affca}

\begin{CompactList}\small\item\em Compute log-probability of multiple values argument {\tt val}. \item\end{CompactList}\item 
\hypertarget{classepdf_e87dc8260a5c37bc1b03eb66174741a0}{
virtual \hyperlink{classmpdf}{mpdf} $\ast$ \hyperlink{classepdf_e87dc8260a5c37bc1b03eb66174741a0}{condition} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const }
\label{classepdf_e87dc8260a5c37bc1b03eb66174741a0}

\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 
\hypertarget{classepdf_38de9f59b65ee06028554f3f74b66025}{
virtual \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classepdf_38de9f59b65ee06028554f3f74b66025}{marginal} (const \hyperlink{classRV}{RV} \&\hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}) const }
\label{classepdf_38de9f59b65ee06028554f3f74b66025}

\begin{CompactList}\small\item\em Return marginal density on the given \hyperlink{classRV}{RV}, the remainig rvs are intergrated out. \item\end{CompactList}\item 
\hypertarget{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{
const \hyperlink{classRV}{RV} \& \hyperlink{classepdf_ca0d32aabb4cbba347e0c37fe8607562}{\_\-rv} () const }
\label{classepdf_ca0d32aabb4cbba347e0c37fe8607562}

\begin{CompactList}\small\item\em access function, possibly dangerous! \item\end{CompactList}\item 
\hypertarget{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{
void \hyperlink{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}{\_\-renewrv} (const \hyperlink{classRV}{RV} \&in\_\-rv)}
\label{classepdf_7fb94ce90d1ac7077d29f7d6a6c3e0a5}

\begin{CompactList}\small\item\em modifier function - useful when copying epdfs \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classeigamma_ea00e33f405ebd918e06cede968a735b}{
vec $\ast$ \hyperlink{classeigamma_ea00e33f405ebd918e06cede968a735b}{alpha}}
\label{classeigamma_ea00e33f405ebd918e06cede968a735b}

\begin{CompactList}\small\item\em Vector $\alpha$. \item\end{CompactList}\item 
\hypertarget{classeigamma_ee446ec667a4df391e0db41decb2d558}{
vec $\ast$ \hyperlink{classeigamma_ee446ec667a4df391e0db41decb2d558}{beta}}
\label{classeigamma_ee446ec667a4df391e0db41decb2d558}

\begin{CompactList}\small\item\em Vector $\beta$ (in fact it is 1/beta as used in definition of iG). \item\end{CompactList}\item 
\hypertarget{classeigamma_906f2a3a8fbf08b2af49776f2f1be5d4}{
\hyperlink{classegamma}{egamma} \hyperlink{classeigamma_906f2a3a8fbf08b2af49776f2f1be5d4}{eg}}
\label{classeigamma_906f2a3a8fbf08b2af49776f2f1be5d4}

\begin{CompactList}\small\item\em internal \hyperlink{classegamma}{egamma} \item\end{CompactList}\item 
\hypertarget{classepdf_74da992e3f5d598da8850b646b79b9d9}{
\hyperlink{classRV}{RV} \hyperlink{classepdf_74da992e3f5d598da8850b646b79b9d9}{rv}}
\label{classepdf_74da992e3f5d598da8850b646b79b9d9}

\begin{CompactList}\small\item\em Identified of the random variable. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Inverse-Gamma posterior density. 

Multivariate inverse-Gamma density as product of independent univariate densities. \[ f(x|\alpha,\beta) = \prod f(x_i|\alpha_i,\beta_i) \]

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. 

The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
work/git/mixpp/bdm/stat/\hyperlink{libEF_8h}{libEF.h}\end{CompactItemize}
