\section{Gaussian\+Distribution Class Reference}
\label{classmlpack_1_1distribution_1_1GaussianDistribution}\index{Gaussian\+Distribution@{Gaussian\+Distribution}}


A single multivariate Gaussian distribution.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Gaussian\+Distribution} ()
\begin{DoxyCompactList}\small\item\em Default constructor, which creates a Gaussian with zero dimension. \end{DoxyCompactList}\item 
\textbf{ Gaussian\+Distribution} (const size\+\_\+t dimension)
\begin{DoxyCompactList}\small\item\em Create a Gaussian distribution with zero mean and identity covariance with the given dimensionality. \end{DoxyCompactList}\item 
\textbf{ Gaussian\+Distribution} (const arma\+::vec \&mean, const arma\+::mat \&covariance)
\begin{DoxyCompactList}\small\item\em Create a Gaussian distribution with the given mean and covariance. \end{DoxyCompactList}\item 
const arma\+::mat \& \textbf{ Covariance} () const
\begin{DoxyCompactList}\small\item\em Return the covariance matrix. \end{DoxyCompactList}\item 
void \textbf{ Covariance} (const arma\+::mat \&covariance)
\begin{DoxyCompactList}\small\item\em Set the covariance. \end{DoxyCompactList}\item 
void \textbf{ Covariance} (arma\+::mat \&\&covariance)
\item 
size\+\_\+t \textbf{ Dimensionality} () const
\begin{DoxyCompactList}\small\item\em Return the dimensionality of this distribution. \end{DoxyCompactList}\item 
const arma\+::mat \& \textbf{ Inv\+Cov} () const
\begin{DoxyCompactList}\small\item\em Return the inv\+Cov. \end{DoxyCompactList}\item 
double \textbf{ Log\+Det\+Cov} () const
\begin{DoxyCompactList}\small\item\em Return the log\+Det\+Cov. \end{DoxyCompactList}\item 
double \textbf{ Log\+Probability} (const arma\+::vec \&observation) const
\begin{DoxyCompactList}\small\item\em Return the log probability of the given observation. \end{DoxyCompactList}\item 
void \textbf{ Log\+Probability} (const arma\+::mat \&x, arma\+::vec \&log\+Probabilities) const
\begin{DoxyCompactList}\small\item\em Returns the \doxyref{Log}{p.}{classmlpack_1_1Log} probability of the given matrix. \end{DoxyCompactList}\item 
const arma\+::vec \& \textbf{ Mean} () const
\begin{DoxyCompactList}\small\item\em Return the mean. \end{DoxyCompactList}\item 
arma\+::vec \& \textbf{ Mean} ()
\begin{DoxyCompactList}\small\item\em Return a modifiable copy of the mean. \end{DoxyCompactList}\item 
double \textbf{ Probability} (const arma\+::vec \&observation) const
\begin{DoxyCompactList}\small\item\em Return the probability of the given observation. \end{DoxyCompactList}\item 
void \textbf{ Probability} (const arma\+::mat \&x, arma\+::vec \&probabilities) const
\begin{DoxyCompactList}\small\item\em Calculates the multivariate Gaussian probability density function for each data point (column) in the given matrix. \end{DoxyCompactList}\item 
arma\+::vec \textbf{ Random} () const
\begin{DoxyCompactList}\small\item\em Return a randomly generated observation according to the probability distribution defined by this object. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the distribution. \end{DoxyCompactList}\item 
void \textbf{ Train} (const arma\+::mat \&observations)
\begin{DoxyCompactList}\small\item\em Estimate the Gaussian distribution directly from the given observations. \end{DoxyCompactList}\item 
void \textbf{ Train} (const arma\+::mat \&observations, const arma\+::vec \&probabilities)
\begin{DoxyCompactList}\small\item\em Estimate the Gaussian distribution from the given observations, taking into account the probability of each observation actually being from this distribution. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A single multivariate Gaussian distribution. 

Definition at line 24 of file gaussian\+\_\+distribution.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a53336d1b90883f2d488956588e1b3a92}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Gaussian\+Distribution@{Gaussian\+Distribution}}
\index{Gaussian\+Distribution@{Gaussian\+Distribution}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Gaussian\+Distribution()\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \textbf{ Gaussian\+Distribution} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Default constructor, which creates a Gaussian with zero dimension. 



Definition at line 45 of file gaussian\+\_\+distribution.\+hpp.



Referenced by Gaussian\+Distribution\+::\+Gaussian\+Distribution().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a050cc3343306ceecd93f1ac9681c5e9f}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Gaussian\+Distribution@{Gaussian\+Distribution}}
\index{Gaussian\+Distribution@{Gaussian\+Distribution}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Gaussian\+Distribution()\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \textbf{ Gaussian\+Distribution} (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{dimension }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create a Gaussian distribution with zero mean and identity covariance with the given dimensionality. 



Definition at line 51 of file gaussian\+\_\+distribution.\+hpp.



References Gaussian\+Distribution\+::\+Gaussian\+Distribution().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_af7cc39bc7a94d9714077d9806bc5bd8c}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Gaussian\+Distribution@{Gaussian\+Distribution}}
\index{Gaussian\+Distribution@{Gaussian\+Distribution}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Gaussian\+Distribution()\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \textbf{ Gaussian\+Distribution} (\begin{DoxyParamCaption}\item[{const arma\+::vec \&}]{mean,  }\item[{const arma\+::mat \&}]{covariance }\end{DoxyParamCaption})}



Create a Gaussian distribution with the given mean and covariance. 

covariance is expected to be positive definite. 

\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a7cab8a0b8c0deac1833f3e489fa52daf}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Covariance@{Covariance}}
\index{Covariance@{Covariance}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Covariance()\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily const arma\+::mat\& Covariance (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the covariance matrix. 



Definition at line 162 of file gaussian\+\_\+distribution.\+hpp.



Referenced by Regression\+Distribution\+::\+Regression\+Distribution().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a46cee4ce00705ebf88f655a0c29e4f18}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Covariance@{Covariance}}
\index{Covariance@{Covariance}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Covariance()\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily void Covariance (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{covariance }\end{DoxyParamCaption})}



Set the covariance. 

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a6420d8fe7bf6a71560c29f9182d1630b}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Covariance@{Covariance}}
\index{Covariance@{Covariance}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Covariance()\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily void Covariance (\begin{DoxyParamCaption}\item[{arma\+::mat \&\&}]{covariance }\end{DoxyParamCaption})}

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a78eda6bfb9e9462afa0fc85e32abe1af}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Dimensionality@{Dimensionality}}
\index{Dimensionality@{Dimensionality}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Dimensionality()}
{\footnotesize\ttfamily size\+\_\+t Dimensionality (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the dimensionality of this distribution. 



Definition at line 69 of file gaussian\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a0f98cea1a02c1da3ac5bc8415578642b}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Inv\+Cov@{Inv\+Cov}}
\index{Inv\+Cov@{Inv\+Cov}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Inv\+Cov()}
{\footnotesize\ttfamily const arma\+::mat\& Inv\+Cov (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the inv\+Cov. 



Definition at line 172 of file gaussian\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_abe34707f59b9f2193bbd38cf8df9ad28}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Log\+Det\+Cov@{Log\+Det\+Cov}}
\index{Log\+Det\+Cov@{Log\+Det\+Cov}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Log\+Det\+Cov()}
{\footnotesize\ttfamily double Log\+Det\+Cov (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the log\+Det\+Cov. 



Definition at line 175 of file gaussian\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a7063c1fb92f512f32bf44542c7528739}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Log\+Probability@{Log\+Probability}}
\index{Log\+Probability@{Log\+Probability}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Log\+Probability()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Log\+Probability (\begin{DoxyParamCaption}\item[{const arma\+::vec \&}]{observation }\end{DoxyParamCaption}) const}



Return the log probability of the given observation. 



Referenced by Gaussian\+Distribution\+::\+Probability().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_aabd4dbf56bd3d719aede447516d68296}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Log\+Probability@{Log\+Probability}}
\index{Log\+Probability@{Log\+Probability}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Log\+Probability()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Log\+Probability (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{x,  }\item[{arma\+::vec \&}]{log\+Probabilities }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns the \doxyref{Log}{p.}{classmlpack_1_1Log} probability of the given matrix. 

These values are stored in log\+Probabilities.


\begin{DoxyParams}{Parameters}
{\em x} & List of observations. \\
\hline
{\em log\+Probabilities} & Output log probabilities for each input observation. \\
\hline
\end{DoxyParams}


Definition at line 108 of file gaussian\+\_\+distribution.\+hpp.



References Gaussian\+Distribution\+::\+Random(), and Gaussian\+Distribution\+::\+Train().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a6db5f5d76cbd055347cecd9ca90eea86}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Mean@{Mean}}
\index{Mean@{Mean}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Mean()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const arma\+::vec\& Mean (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the mean. 



Definition at line 152 of file gaussian\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a94becb1cd872c0334328c37f130db253}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Mean@{Mean}}
\index{Mean@{Mean}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Mean()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily arma\+::vec\& Mean (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Return a modifiable copy of the mean. 



Definition at line 157 of file gaussian\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_ab72935d592516e77511d0b5e703c0d41}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Probability@{Probability}}
\index{Probability@{Probability}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Probability()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Probability (\begin{DoxyParamCaption}\item[{const arma\+::vec \&}]{observation }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the probability of the given observation. 



Definition at line 74 of file gaussian\+\_\+distribution.\+hpp.



References Gaussian\+Distribution\+::\+Log\+Probability().



Referenced by Gaussian\+Distribution\+::\+Probability().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a1e516aca34e9c99caf1431a822d87fc6}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Probability@{Probability}}
\index{Probability@{Probability}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Probability()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Probability (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{x,  }\item[{arma\+::vec \&}]{probabilities }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Calculates the multivariate Gaussian probability density function for each data point (column) in the given matrix. 


\begin{DoxyParams}{Parameters}
{\em x} & List of observations. \\
\hline
{\em probabilities} & Output probabilities for each input observation. \\
\hline
\end{DoxyParams}


Definition at line 91 of file gaussian\+\_\+distribution.\+hpp.



References Gaussian\+Distribution\+::\+Probability().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a2c6f8d5bb4eacf7de767d2172b320756}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Random@{Random}}
\index{Random@{Random}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Random()}
{\footnotesize\ttfamily arma\+::vec Random (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Return a randomly generated observation according to the probability distribution defined by this object. 

\begin{DoxyReturn}{Returns}
Random observation from this Gaussian distribution. 
\end{DoxyReturn}


Referenced by Logistic\+Regression\+Test\+Data(), and Gaussian\+Distribution\+::\+Log\+Probability().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Serialize the distribution. 



Definition at line 181 of file gaussian\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_a269c6f8a40ce41a5f7b6d035aef58238}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Train@{Train}}
\index{Train@{Train}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Train()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void Train (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{observations }\end{DoxyParamCaption})}



Estimate the Gaussian distribution directly from the given observations. 


\begin{DoxyParams}{Parameters}
{\em observations} & List of observations. \\
\hline
\end{DoxyParams}


Referenced by Gaussian\+Distribution\+::\+Log\+Probability().

\mbox{\label{classmlpack_1_1distribution_1_1GaussianDistribution_ad71152f8853ac60c92a165ed72384125}} 
\index{mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}!Train@{Train}}
\index{Train@{Train}!mlpack\+::distribution\+::\+Gaussian\+Distribution@{mlpack\+::distribution\+::\+Gaussian\+Distribution}}
\subsubsection{Train()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Train (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{observations,  }\item[{const arma\+::vec \&}]{probabilities }\end{DoxyParamCaption})}



Estimate the Gaussian distribution from the given observations, taking into account the probability of each observation actually being from this distribution. 



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/core/dists/\textbf{ gaussian\+\_\+distribution.\+hpp}\end{DoxyCompactItemize}
