\hypertarget{classbdm_1_1eigamma}{
\section{bdm::eigamma Class Reference}
\label{classbdm_1_1eigamma}\index{bdm::eigamma@{bdm::eigamma}}
}
{\tt \#include $<$libEF.h$>$}

Inheritance diagram for bdm::eigamma::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{classbdm_1_1eigamma}
\end{center}
\end{figure}


\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 \[ x\sim iG(a,b) => 1/x\sim G(a,1/b) \] This relation is used in sampling. \subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1eigamma_3aff7bf25ddac27731c60826fcfd878f}{
vec \hyperlink{classbdm_1_1eigamma_3aff7bf25ddac27731c60826fcfd878f}{sample} () const }
\label{classbdm_1_1eigamma_3aff7bf25ddac27731c60826fcfd878f}

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

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

\begin{CompactList}\small\item\em logarithm of the normalizing constant, $\mathcal{I}$ \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eigamma_46cecb295edbabd28120cb0f6f572bcb}{
vec \hyperlink{classbdm_1_1eigamma_46cecb295edbabd28120cb0f6f572bcb}{mean} () const }
\label{classbdm_1_1eigamma_46cecb295edbabd28120cb0f6f572bcb}

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

\begin{CompactList}\small\item\em return expected variance (not covariance!) \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eigamma_0b3693d30bcc8c6bd873f9c49825cdeb}{
vec \& \textbf{\_\-alpha} ()}
\label{classbdm_1_1eigamma_0b3693d30bcc8c6bd873f9c49825cdeb}

\item 
\hypertarget{classbdm_1_1eigamma_d5aa95bce22824f16b46f8cd3ace9dae}{
vec \& \textbf{\_\-beta} ()}
\label{classbdm_1_1eigamma_d5aa95bce22824f16b46f8cd3ace9dae}

\item 
\hypertarget{classbdm_1_1eEF_deef7d6273ba4d5a5cf0bbd91ec7277a}{
virtual void \hyperlink{classbdm_1_1eEF_deef7d6273ba4d5a5cf0bbd91ec7277a}{dupdate} (mat \&v)}
\label{classbdm_1_1eEF_deef7d6273ba4d5a5cf0bbd91ec7277a}

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

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

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

\begin{CompactList}\small\item\em Power of the density, used e.g. to flatten the density. \item\end{CompactList}\end{CompactItemize}
\begin{Indent}{\bf Constructors}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1eigamma_b496396f3511ce87d7ae3830ba94262c}{
\textbf{eigamma} ()}
\label{classbdm_1_1eigamma_b496396f3511ce87d7ae3830ba94262c}

\item 
\hypertarget{classbdm_1_1eigamma_2870f6a8ffda9eb2fbaf9f85ea04c05f}{
\textbf{eigamma} (const vec \&a, const vec \&b)}
\label{classbdm_1_1eigamma_2870f6a8ffda9eb2fbaf9f85ea04c05f}

\item 
\hypertarget{classbdm_1_1eigamma_09e616c95f31acddf7dfef96d1c5d645}{
void \textbf{set\_\-parameters} (const vec \&a, const vec \&b)}
\label{classbdm_1_1eigamma_09e616c95f31acddf7dfef96d1c5d645}

\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Constructors}\par
{\em Construction of each \hyperlink{classbdm_1_1epdf}{epdf} should support two types of constructors: \begin{itemize}
\item empty constructor, \item copy constructor,\end{itemize}
The following constructors should be supported for convenience: \begin{itemize}
\item constructor followed by calling {\tt set\_\-parameters()} \item constructor accepting random variables calling {\tt \hyperlink{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{set\_\-rv()}} \end{itemize}
All internal data structures are constructed as empty. Their values (including sizes) will be set by method {\tt set\_\-parameters()}. This way references can be initialized in constructors. }\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1epdf_840de94aa33cf4f2ebd2427f45a165d8}{
void \textbf{set\_\-parameters} (int dim0)}
\label{classbdm_1_1epdf_840de94aa33cf4f2ebd2427f45a165d8}

\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Matematical Operations}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{
virtual mat \hyperlink{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}{sample\_\-m} (int N) const }
\label{classbdm_1_1epdf_b4cf45fd83cc7573ede9fe1215256058}

\begin{CompactList}\small\item\em Returns N samples, $ [x_1 , x_2 , \ldots \ $ from density $ f_x(rv)$. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{
virtual vec \hyperlink{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}{evallog\_\-m} (const mat \&Val) const }
\label{classbdm_1_1epdf_34956d4dd3176eeb5937cf48a1546b62}

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

\begin{CompactList}\small\item\em Return conditional density on the given \hyperlink{classbdm_1_1RV}{RV}, the remaining rvs will be in conditioning. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}{
virtual \hyperlink{classbdm_1_1epdf}{epdf} $\ast$ \hyperlink{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}{marginal} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}) const }
\label{classbdm_1_1epdf_3fb2ece54f720b62ad325e61214fa0a1}

\begin{CompactList}\small\item\em Return marginal density on the given \hyperlink{classbdm_1_1RV}{RV}, the remainig rvs are intergrated out. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Connection to other classes}\par
{\em Description of the random quantity via attribute {\tt rv} is optional. For operations such as sampling {\tt rv} does not need to be set. However, for {\tt marginalization} and {\tt conditioning} {\tt rv} has to be set. NB: }\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{
void \hyperlink{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}{set\_\-rv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0)}
\label{classbdm_1_1epdf_f423e28448dbb69ef4905295ec8de8ff}

\begin{CompactList}\small\item\em Name its rv. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{
bool \hyperlink{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}{isnamed} () const }
\label{classbdm_1_1epdf_c4b863ff84c7a4882fb3ad18556027f9}

\begin{CompactList}\small\item\em True if rv is assigned. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{
const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}{\_\-rv} () const }
\label{classbdm_1_1epdf_a4ab378d5e004c3ff3e2d4e64f7bba21}

\begin{CompactList}\small\item\em Return name (fails when isnamed is false). \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Access to attributes}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1epdf_7083a65f7b7a0d0d13b2c516bd2ec29c}{
int \hyperlink{classbdm_1_1epdf_7083a65f7b7a0d0d13b2c516bd2ec29c}{dimension} () const }
\label{classbdm_1_1epdf_7083a65f7b7a0d0d13b2c516bd2ec29c}

\begin{CompactList}\small\item\em Size of the random variable. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1eigamma_3e5c03201f073033a7db894fa15ddb96}{
\hyperlink{classbdm_1_1egamma}{egamma} \hyperlink{classbdm_1_1eigamma_3e5c03201f073033a7db894fa15ddb96}{eg}}
\label{classbdm_1_1eigamma_3e5c03201f073033a7db894fa15ddb96}

\begin{CompactList}\small\item\em internal \hyperlink{classbdm_1_1egamma}{egamma} \item\end{CompactList}\item 
\hypertarget{classbdm_1_1eigamma_494fafd76d9448395efe160c9ba11ab6}{
vec \& \hyperlink{classbdm_1_1eigamma_494fafd76d9448395efe160c9ba11ab6}{alpha}}
\label{classbdm_1_1eigamma_494fafd76d9448395efe160c9ba11ab6}

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

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

\begin{CompactList}\small\item\em dimension of the random variable \item\end{CompactList}\item 
\hypertarget{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}{rv}}
\label{classbdm_1_1epdf_62c5b8ff71d9ebe6cd58d3c342eb1dc8}

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


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