LaplaceDistribution Class Reference

The multivariate Laplace distribution centered at 0 has pdf. More...

Public Member Functions

 LaplaceDistribution ()
 Default constructor, which creates a Laplace distribution with zero dimension and zero scale parameter. More...

 
 LaplaceDistribution (const size_t dimensionality, const double scale)
 Construct the Laplace distribution with the given scale and dimensionality. More...

 
 LaplaceDistribution (const arma::vec &mean, const double scale)
 Construct the Laplace distribution with the given mean and scale parameter. More...

 
size_t Dimensionality () const
 Return the dimensionality of this distribution. More...

 
void Estimate (const arma::mat &observations)
 Estimate the Laplace distribution directly from the given observations. More...

 
void Estimate (const arma::mat &observations, const arma::vec &probabilities)
 Estimate the Laplace distribution from the given observations, taking into account the probability of each observation actually being from this distribution. More...

 
double LogProbability (const arma::vec &observation) const
 Return the log probability of the given observation. More...

 
void LogProbability (const arma::mat &x, arma::vec &logProbabilities) const
 Evaluate log probability density function of given observation. More...

 
const arma::vec & Mean () const
 Return the mean. More...

 
arma::vec & Mean ()
 Modify the mean. More...

 
double Probability (const arma::vec &observation) const
 Return the probability of the given observation. More...

 
void Probability (const arma::mat &x, arma::vec &probabilities) const
 Evaluate probability density function of given observation. More...

 
arma::vec Random () const
 Return a randomly generated observation according to the probability distribution defined by this object. More...

 
double Scale () const
 Return the scale parameter. More...

 
double & Scale ()
 Modify the scale parameter. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the distribution. More...

 

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:

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

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

Definition at line 50 of file laplace_distribution.hpp.

Constructor & Destructor Documentation

◆ LaplaceDistribution() [1/3]

LaplaceDistribution ( )
inline

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

Definition at line 57 of file laplace_distribution.hpp.

◆ LaplaceDistribution() [2/3]

LaplaceDistribution ( const size_t  dimensionality,
const double  scale 
)
inline

Construct the Laplace distribution with the given scale and dimensionality.

The mean is initialized to zero.

Parameters
dimensionalityDimensionality of distribution.
scaleScale of distribution.

Definition at line 66 of file laplace_distribution.hpp.

◆ LaplaceDistribution() [3/3]

LaplaceDistribution ( const arma::vec &  mean,
const double  scale 
)
inline

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

Parameters
meanMean of distribution.
scaleScale of distribution.

Definition at line 76 of file laplace_distribution.hpp.

Member Function Documentation

◆ Dimensionality()

size_t Dimensionality ( ) const
inline

Return the dimensionality of this distribution.

Definition at line 80 of file laplace_distribution.hpp.

◆ Estimate() [1/2]

void Estimate ( const arma::mat &  observations)

Estimate the Laplace distribution directly from the given observations.

Parameters
observationsList of observations.

Referenced by LaplaceDistribution::Random().

◆ Estimate() [2/2]

void Estimate ( const arma::mat &  observations,
const arma::vec &  probabilities 
)

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

◆ LogProbability() [1/2]

double LogProbability ( const arma::vec &  observation) const

Return the log probability of the given observation.

Parameters
observationPoint to evaluate logarithm of probability.

Referenced by LaplaceDistribution::LogProbability(), and LaplaceDistribution::Probability().

◆ LogProbability() [2/2]

void LogProbability ( const arma::mat &  x,
arma::vec &  logProbabilities 
) const
inline

Evaluate log probability density function of given observation.

Parameters
xList of observations.
logProbabilitiesOutput probabilities for each input observation.

Definition at line 113 of file laplace_distribution.hpp.

References LaplaceDistribution::LogProbability().

◆ Mean() [1/2]

const arma::vec& Mean ( ) const
inline

Return the mean.

Definition at line 163 of file laplace_distribution.hpp.

◆ Mean() [2/2]

arma::vec& Mean ( )
inline

Modify the mean.

Definition at line 165 of file laplace_distribution.hpp.

◆ Probability() [1/2]

double Probability ( const arma::vec &  observation) const
inline

Return the probability of the given observation.

Parameters
observationPoint to evaluate probability at.

Definition at line 87 of file laplace_distribution.hpp.

References LaplaceDistribution::LogProbability().

◆ Probability() [2/2]

void Probability ( const arma::mat &  x,
arma::vec &  probabilities 
) const

Evaluate probability density function of given observation.

Parameters
xList of observations.
probabilitiesOutput probabilities for each input observation.

◆ Random()

arma::vec Random ( ) const
inline

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

This is inlined for speed.

Returns
Random observation from this Laplace distribution.

Definition at line 128 of file laplace_distribution.hpp.

References LaplaceDistribution::Estimate().

◆ Scale() [1/2]

double Scale ( ) const
inline

Return the scale parameter.

Definition at line 168 of file laplace_distribution.hpp.

◆ Scale() [2/2]

double& Scale ( )
inline

Modify the scale parameter.

Definition at line 170 of file laplace_distribution.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)
inline

Serialize the distribution.

Definition at line 176 of file laplace_distribution.hpp.


The documentation for this class was generated from the following file: