\section{Laplace\+Distribution Class Reference}
\label{classmlpack_1_1distribution_1_1LaplaceDistribution}\index{Laplace\+Distribution@{Laplace\+Distribution}}


The multivariate Laplace distribution centered at 0 has pdf.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Laplace\+Distribution} ()
\begin{DoxyCompactList}\small\item\em Default constructor, which creates a Laplace distribution with zero dimension and zero scale parameter. \end{DoxyCompactList}\item 
\textbf{ Laplace\+Distribution} (const size\+\_\+t dimensionality, const double scale)
\begin{DoxyCompactList}\small\item\em Construct the Laplace distribution with the given scale and dimensionality. \end{DoxyCompactList}\item 
\textbf{ Laplace\+Distribution} (const arma\+::vec \&mean, const double scale)
\begin{DoxyCompactList}\small\item\em Construct the Laplace distribution with the given mean and scale parameter. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Dimensionality} () const
\begin{DoxyCompactList}\small\item\em Return the dimensionality of this distribution. \end{DoxyCompactList}\item 
void \textbf{ Estimate} (const arma\+::mat \&observations)
\begin{DoxyCompactList}\small\item\em Estimate the Laplace distribution directly from the given observations. \end{DoxyCompactList}\item 
void \textbf{ Estimate} (const arma\+::mat \&observations, const arma\+::vec \&probabilities)
\begin{DoxyCompactList}\small\item\em Estimate the Laplace distribution from the given observations, taking into account the probability of each observation actually being from this distribution. \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 Evaluate log probability density function of given observation. \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 Modify 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 Evaluate probability density function of given observation. \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 
double \textbf{ Scale} () const
\begin{DoxyCompactList}\small\item\em Return the scale parameter. \end{DoxyCompactList}\item 
double \& \textbf{ Scale} ()
\begin{DoxyCompactList}\small\item\em Modify the scale parameter. \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}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The multivariate Laplace distribution centered at 0 has pdf. 

\[ f(x|\theta) = \frac{1}{2 \theta}\exp\left(-\frac{\|x - \mu\|}{\theta}\right) \]

given scale parameter $\theta$ and mean $\mu$. This implementation assumes a diagonal covariance, but a rewrite to support arbitrary covariances is possible.

See the following paper for more information on the non-\/diagonal-\/covariance Laplace distribution and estimation techniques\+:


\begin{DoxyCode}
@article\{eltoft2006multivariate,
  title=\{\{On the Multivariate Laplace Distribution\}\},
  author=\{Eltoft, Torbj\(\backslash\)orn and Kim, Taesu and Lee, Te-Won\},
  journal=\{IEEE Signal Processing Letters\},
  volume=\{13\},
  number=\{5\},
  pages=\{300--304\},
  year=\{2006\}
\}
\end{DoxyCode}


Note that because of the diagonal covariance restriction, much of the algebra in the paper above becomes simplified, and the P\+DF takes roughly the same form as the univariate case. 

Definition at line 50 of file laplace\+\_\+distribution.\+hpp.



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



Default constructor, which creates a Laplace distribution with zero dimension and zero scale parameter. 



Definition at line 57 of file laplace\+\_\+distribution.\+hpp.

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



Construct the Laplace distribution with the given scale and dimensionality. 

The mean is initialized to zero.


\begin{DoxyParams}{Parameters}
{\em dimensionality} & Dimensionality of distribution. \\
\hline
{\em scale} & Scale of distribution. \\
\hline
\end{DoxyParams}


Definition at line 66 of file laplace\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_a4d7d471d63f2b083d0f445eaaac1fc5c}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Laplace\+Distribution@{Laplace\+Distribution}}
\index{Laplace\+Distribution@{Laplace\+Distribution}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}}
\subsubsection{Laplace\+Distribution()\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \textbf{ Laplace\+Distribution} (\begin{DoxyParamCaption}\item[{const arma\+::vec \&}]{mean,  }\item[{const double}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct the Laplace distribution with the given mean and scale parameter. 


\begin{DoxyParams}{Parameters}
{\em mean} & Mean of distribution. \\
\hline
{\em scale} & Scale of distribution. \\
\hline
\end{DoxyParams}


Definition at line 76 of file laplace\+\_\+distribution.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_a78eda6bfb9e9462afa0fc85e32abe1af}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Dimensionality@{Dimensionality}}
\index{Dimensionality@{Dimensionality}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+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 80 of file laplace\+\_\+distribution.\+hpp.

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



Estimate the Laplace distribution directly from the given observations. 


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


Referenced by Laplace\+Distribution\+::\+Random().

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



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

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_a7063c1fb92f512f32bf44542c7528739}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Log\+Probability@{Log\+Probability}}
\index{Log\+Probability@{Log\+Probability}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+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. 


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


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

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_aabd4dbf56bd3d719aede447516d68296}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Log\+Probability@{Log\+Probability}}
\index{Log\+Probability@{Log\+Probability}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+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]}}



Evaluate log probability density function of given observation. 


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


Definition at line 113 of file laplace\+\_\+distribution.\+hpp.



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

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_a6db5f5d76cbd055347cecd9ca90eea86}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Mean@{Mean}}
\index{Mean@{Mean}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+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 163 of file laplace\+\_\+distribution.\+hpp.

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



Modify the mean. 



Definition at line 165 of file laplace\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_ab72935d592516e77511d0b5e703c0d41}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Probability@{Probability}}
\index{Probability@{Probability}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+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. 


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


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



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

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_a1e516aca34e9c99caf1431a822d87fc6}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Probability@{Probability}}
\index{Probability@{Probability}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+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}



Evaluate probability density function of given observation. 


\begin{DoxyParams}{Parameters}
{\em x} & List of observations. \\
\hline
{\em probabilities} & Output probabilities for each input observation. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_a2c6f8d5bb4eacf7de767d2172b320756}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Random@{Random}}
\index{Random@{Random}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}}
\subsubsection{Random()}
{\footnotesize\ttfamily arma\+::vec Random (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



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

This is inlined for speed.

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


Definition at line 128 of file laplace\+\_\+distribution.\+hpp.



References Laplace\+Distribution\+::\+Estimate().

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_ab30d1e52df44eb451081926df999fc17}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Scale@{Scale}}
\index{Scale@{Scale}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}}
\subsubsection{Scale()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Scale (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the scale parameter. 



Definition at line 168 of file laplace\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_a8190151e4134e9f69f1f51cd013ba43c}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!Scale@{Scale}}
\index{Scale@{Scale}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}}
\subsubsection{Scale()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double\& Scale (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the scale parameter. 



Definition at line 170 of file laplace\+\_\+distribution.\+hpp.

\mbox{\label{classmlpack_1_1distribution_1_1LaplaceDistribution_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+Distribution}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::distribution\+::\+Laplace\+Distribution@{mlpack\+::distribution\+::\+Laplace\+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 176 of file laplace\+\_\+distribution.\+hpp.



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{ laplace\+\_\+distribution.\+hpp}\end{DoxyCompactItemize}
