MLPACK
1.0.10
|
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... | |
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... | |
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... | |
std::string | ToString () const |
Return a string representation of the object. More... | |
Private Attributes | |
arma::vec | mean |
Mean of the distribution. More... | |
double | scale |
Scale parameter of the distribution. More... | |
The multivariate Laplace distribution centered at 0 has pdf.
given scale parameter and mean
. 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:
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 59 of file laplace_distribution.hpp.
|
inline |
Default constructor, which creates a Laplace distribution with zero dimension and zero scale parameter.
Definition at line 66 of file laplace_distribution.hpp.
|
inline |
Construct the Laplace distribution with the given scale and dimensionality.
The mean is initialized to zero.
dimensionality | Dimensionality of distribution. |
scale | Scale of distribution. |
Definition at line 75 of file laplace_distribution.hpp.
|
inline |
Construct the Laplace distribution with the given mean and scale parameter.
mean | Mean of distribution. |
scale | Scale of distribution. |
Definition at line 84 of file laplace_distribution.hpp.
|
inline |
Return the dimensionality of this distribution.
Definition at line 88 of file laplace_distribution.hpp.
References mean.
void mlpack::distribution::LaplaceDistribution::Estimate | ( | const arma::mat & | observations | ) |
Estimate the Laplace distribution directly from the given observations.
observations | List of observations. |
void mlpack::distribution::LaplaceDistribution::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.
|
inline |
|
inline |
double mlpack::distribution::LaplaceDistribution::Probability | ( | const arma::vec & | observation | ) | const |
Return the probability of the given observation.
|
inline |
Return a randomly generated observation according to the probability distribution defined by this object.
This is inlined for speed.
Definition at line 101 of file laplace_distribution.hpp.
|
inline |
Return the scale parameter.
Definition at line 143 of file laplace_distribution.hpp.
References scale.
|
inline |
Modify the scale parameter.
Definition at line 145 of file laplace_distribution.hpp.
References scale.
std::string mlpack::distribution::LaplaceDistribution::ToString | ( | ) | const |
Return a string representation of the object.
|
private |
Mean of the distribution.
Definition at line 152 of file laplace_distribution.hpp.
Referenced by Dimensionality(), Mean(), and Random().
|
private |
Scale parameter of the distribution.
Definition at line 154 of file laplace_distribution.hpp.