\section{Regression\+Distribution Class Reference}
\label{classmlpack_1_1distribution_1_1RegressionDistribution}\index{Regression\+Distribution@{Regression\+Distribution}}


A class that represents a univariate conditionally Gaussian distribution.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Regression\+Distribution} ()
\begin{DoxyCompactList}\small\item\em Default constructor, which creates a Gaussian with zero dimension. \end{DoxyCompactList}\item 
\textbf{ mlpack\+\_\+deprecated} \textbf{ Regression\+Distribution} (const arma\+::mat \&predictors, const arma\+::vec \&responses)
\begin{DoxyCompactList}\small\item\em Create a Conditional Gaussian distribution with conditional mean function obtained by running Regression\+Function on predictors, responses. \end{DoxyCompactList}\item 
\textbf{ Regression\+Distribution} (const arma\+::mat \&predictors, const arma\+::rowvec \&responses)
\begin{DoxyCompactList}\small\item\em Create a Conditional Gaussian distribution with conditional mean function obtained by running Regression\+Function on predictors, responses. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Dimensionality} () const
\begin{DoxyCompactList}\small\item\em Return the dimensionality. \end{DoxyCompactList}\item 
const \textbf{ Gaussian\+Distribution} \& \textbf{ Err} () const
\begin{DoxyCompactList}\small\item\em Return error distribution. \end{DoxyCompactList}\item 
\textbf{ Gaussian\+Distribution} \& \textbf{ Err} ()
\begin{DoxyCompactList}\small\item\em Modify error distribution. \end{DoxyCompactList}\item 
double \textbf{ Log\+Probability} (const arma\+::vec \&observation) const
\begin{DoxyCompactList}\small\item\em Evaluate log probability density function of given observation. \end{DoxyCompactList}\item 
const arma\+::vec \& \textbf{ Parameters} () const
\begin{DoxyCompactList}\small\item\em Return the parameters (the b vector). \end{DoxyCompactList}\item 
\textbf{ mlpack\+\_\+deprecated} void \textbf{ Predict} (const arma\+::mat \&points, arma\+::vec \&predictions) const
\begin{DoxyCompactList}\small\item\em Calculate y\+\_\+i for each data point in points. \end{DoxyCompactList}\item 
void \textbf{ Predict} (const arma\+::mat \&points, arma\+::rowvec \&predictions) const
\begin{DoxyCompactList}\small\item\em Calculate y\+\_\+i for each data point in points. \end{DoxyCompactList}\item 
double \textbf{ Probability} (const arma\+::vec \&observation) const
\begin{DoxyCompactList}\small\item\em Evaluate probability density function of given observation. \end{DoxyCompactList}\item 
const \textbf{ regression\+::\+Linear\+Regression} \& \textbf{ Rf} () const
\begin{DoxyCompactList}\small\item\em Return regression function. \end{DoxyCompactList}\item 
\textbf{ regression\+::\+Linear\+Regression} \& \textbf{ Rf} ()
\begin{DoxyCompactList}\small\item\em Modify regression function. \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 
\textbf{ mlpack\+\_\+deprecated} void \textbf{ Train} (const arma\+::mat \&observations, const arma\+::vec \&weights)
\begin{DoxyCompactList}\small\item\em Estimate parameters using provided observation weights. \end{DoxyCompactList}\item 
void \textbf{ Train} (const arma\+::mat \&observations, const arma\+::rowvec \&weights)
\begin{DoxyCompactList}\small\item\em Estimate parameters using provided observation weights. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A class that represents a univariate conditionally Gaussian distribution. 

Can be used as an emission distribution with the hmm class to implement H\+MM regression (H\+M\+MR) as described in {\tt https\+://www.\+ima.\+umn.\+edu/preprints/\+January1994/1195.\+pdf} The hmm observations should have the dependent variable in the first row, with the independent variables in the other rows. 

Definition at line 31 of file regression\+\_\+distribution.\+hpp.



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



Default constructor, which creates a Gaussian with zero dimension. 



Definition at line 43 of file regression\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_aed168e6d1511a69840c678b30808e330}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Regression\+Distribution@{Regression\+Distribution}}
\index{Regression\+Distribution@{Regression\+Distribution}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Regression\+Distribution()\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} \textbf{ Regression\+Distribution} (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{predictors,  }\item[{const arma\+::vec \&}]{responses }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create a Conditional Gaussian distribution with conditional mean function obtained by running Regression\+Function on predictors, responses. 


\begin{DoxyParams}{Parameters}
{\em predictors} & Matrix of predictors (X). \\
\hline
{\em responses} & Vector of responses (y). \\
\hline
\end{DoxyParams}


Definition at line 52 of file regression\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_ab3b28892023bf3c2fcef499daf168615}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Regression\+Distribution@{Regression\+Distribution}}
\index{Regression\+Distribution@{Regression\+Distribution}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Regression\+Distribution()\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \textbf{ Regression\+Distribution} (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{predictors,  }\item[{const arma\+::rowvec \&}]{responses }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create a Conditional Gaussian distribution with conditional mean function obtained by running Regression\+Function on predictors, responses. 


\begin{DoxyParams}{Parameters}
{\em predictors} & Matrix of predictors (X). \\
\hline
{\em responses} & Vector of responses (y). \\
\hline
\end{DoxyParams}


Definition at line 64 of file regression\+\_\+distribution.\+hpp.



References Linear\+Regression\+::\+Compute\+Error(), Gaussian\+Distribution\+::\+Covariance(), and Linear\+Regression\+::\+Train().



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



Return the dimensionality. 



Definition at line 156 of file regression\+\_\+distribution.\+hpp.



References Linear\+Regression\+::\+Parameters().

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



Return error distribution. 



Definition at line 90 of file regression\+\_\+distribution.\+hpp.

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



Modify error distribution. 



Definition at line 92 of file regression\+\_\+distribution.\+hpp.



References mlpack\+\_\+deprecated, Regression\+Distribution\+::\+Probability(), and Regression\+Distribution\+::\+Train().

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a7063c1fb92f512f32bf44542c7528739}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Log\+Probability@{Log\+Probability}}
\index{Log\+Probability@{Log\+Probability}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Log\+Probability()}
{\footnotesize\ttfamily double Log\+Probability (\begin{DoxyParamCaption}\item[{const arma\+::vec \&}]{observation }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Evaluate log probability density function of given observation. 


\begin{DoxyParams}{Parameters}
{\em observation} & Point to evaluate log probability at. \\
\hline
\end{DoxyParams}


Definition at line 130 of file regression\+\_\+distribution.\+hpp.



References mlpack\+\_\+deprecated, Regression\+Distribution\+::\+Predict(), and Regression\+Distribution\+::\+Probability().

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a6a67e9b83bb8f0ea6122efcc5f75927c}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Parameters@{Parameters}}
\index{Parameters@{Parameters}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Parameters()}
{\footnotesize\ttfamily const arma\+::vec\& Parameters (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the parameters (the b vector). 



Definition at line 153 of file regression\+\_\+distribution.\+hpp.



References Linear\+Regression\+::\+Parameters().

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a9a40c040f420186809390bdce9c8689a}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Predict@{Predict}}
\index{Predict@{Predict}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Predict()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} void Predict (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{points,  }\item[{arma\+::vec \&}]{predictions }\end{DoxyParamCaption}) const}



Calculate y\+\_\+i for each data point in points. 


\begin{DoxyParams}{Parameters}
{\em points} & The data points to calculate with. \\
\hline
{\em predictions} & Y, will contain calculated values on completion. \\
\hline
\end{DoxyParams}


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

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a71e5e21b1d92756979b32face7b3c573}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Predict@{Predict}}
\index{Predict@{Predict}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Predict()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Predict (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{points,  }\item[{arma\+::rowvec \&}]{predictions }\end{DoxyParamCaption}) const}



Calculate y\+\_\+i for each data point in points. 


\begin{DoxyParams}{Parameters}
{\em points} & The data points to calculate with. \\
\hline
{\em predictions} & Y, will contain calculated values on completion. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_ab72935d592516e77511d0b5e703c0d41}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Probability@{Probability}}
\index{Probability@{Probability}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Probability()}
{\footnotesize\ttfamily double Probability (\begin{DoxyParamCaption}\item[{const arma\+::vec \&}]{observation }\end{DoxyParamCaption}) const}



Evaluate probability density function of given observation. 


\begin{DoxyParams}{Parameters}
{\em observation} & Point to evaluate probability at. \\
\hline
\end{DoxyParams}


Referenced by Regression\+Distribution\+::\+Err(), and Regression\+Distribution\+::\+Log\+Probability().

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a46202caa2b47a86d7cbf42e22c9611cf}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Rf@{Rf}}
\index{Rf@{Rf}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Rf()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const \textbf{ regression\+::\+Linear\+Regression}\& Rf (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return regression function. 



Definition at line 85 of file regression\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a4c492b87b66f72b328b07978eeb1ec26}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Rf@{Rf}}
\index{Rf@{Rf}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Rf()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \textbf{ regression\+::\+Linear\+Regression}\& Rf (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify regression function. 



Definition at line 87 of file regression\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+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 78 of file regression\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a269c6f8a40ce41a5f7b6d035aef58238}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Train@{Train}}
\index{Train@{Train}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Train()\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\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 Regression\+Distribution\+::\+Err().

\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_a5897c02064b5eb7822af7bd795fe42fb}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Train@{Train}}
\index{Train@{Train}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Train()\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \textbf{ mlpack\+\_\+deprecated} void Train (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{observations,  }\item[{const arma\+::vec \&}]{weights }\end{DoxyParamCaption})}



Estimate parameters using provided observation weights. 


\begin{DoxyParams}{Parameters}
{\em observations} & List of observations. \\
\hline
{\em weights} & Probability that given observation is from distribution. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1distribution_1_1RegressionDistribution_ad92c15115a850f977b39368b171e961e}} 
\index{mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}!Train@{Train}}
\index{Train@{Train}!mlpack\+::distribution\+::\+Regression\+Distribution@{mlpack\+::distribution\+::\+Regression\+Distribution}}
\subsubsection{Train()\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily void Train (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{observations,  }\item[{const arma\+::rowvec \&}]{weights }\end{DoxyParamCaption})}



Estimate parameters using provided observation weights. 


\begin{DoxyParams}{Parameters}
{\em observations} & List of observations. \\
\hline
{\em weights} & Probability that given observation is from distribution. \\
\hline
\end{DoxyParams}


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