shark::MultiVariateNormalDistributionCholesky Class Reference

Multivariate normal distribution with zero mean using a cholesky decomposition. More...

#include <shark/Statistics/Distributions/MultiVariateNormalDistribution.h>

Public Member Functions

 MultiVariateNormalDistributionCholesky (RealMatrix const &covariance)
 Constructor. More...
 
 MultiVariateNormalDistributionCholesky ()
 
template<typename Archive >
void serialize (Archive &ar, const std::size_t version)
 Stores/Restores the distribution from the supplied archive. More...
 
void resize (std::size_t size)
 Resizes the distribution. Updates both eigenvectors and eigenvalues. More...
 
std::size_t size () const
 Returns the size of the created vectors. More...
 
void setCovarianceMatrix (RealMatrix const &matrix)
 Sets the new covariance matrix by computing the new cholesky dcomposition. More...
 
blas::matrix< double, blas::column_major > const & lowerCholeskyFactor () const
 Returns the lower cholsky factor. More...
 
blas::matrix< double, blas::column_major > & lowerCholeskyFactor ()
 Returns the lower cholesky factor. More...
 
void rankOneUpdate (double alpha, double beta, RealVector const &v)
 
template<class RngType , class Vector1 , class Vector2 >
void generate (RngType &rng, Vector1 &y, Vector2 &z) const
 
template<class RngType >
result_type operator() (RngType &rng) const
 Samples the distribution. More...
 

Detailed Description

Multivariate normal distribution with zero mean using a cholesky decomposition.

Definition at line 141 of file MultiVariateNormalDistribution.h.

Constructor & Destructor Documentation

§ MultiVariateNormalDistributionCholesky() [1/2]

shark::MultiVariateNormalDistributionCholesky::MultiVariateNormalDistributionCholesky ( RealMatrix const &  covariance)
inline

Constructor.

Parameters
[in]rngthe random number generator
[in]covariancecovariance matrix

Definition at line 153 of file MultiVariateNormalDistribution.h.

References shark::MultiVariateNormalDistribution::setCovarianceMatrix().

§ MultiVariateNormalDistributionCholesky() [2/2]

shark::MultiVariateNormalDistributionCholesky::MultiVariateNormalDistributionCholesky ( )
inline

Definition at line 157 of file MultiVariateNormalDistribution.h.

Member Function Documentation

§ generate()

template<class RngType , class Vector1 , class Vector2 >
void shark::MultiVariateNormalDistributionCholesky::generate ( RngType &  rng,
Vector1 &  y,
Vector2 &  z 
) const
inline

§ lowerCholeskyFactor() [1/2]

blas::matrix<double,blas::column_major> const& shark::MultiVariateNormalDistributionCholesky::lowerCholeskyFactor ( ) const
inline

Returns the lower cholsky factor.

Definition at line 184 of file MultiVariateNormalDistribution.h.

§ lowerCholeskyFactor() [2/2]

blas::matrix<double,blas::column_major>& shark::MultiVariateNormalDistributionCholesky::lowerCholeskyFactor ( )
inline

Returns the lower cholesky factor.

Definition at line 189 of file MultiVariateNormalDistribution.h.

§ operator()()

template<class RngType >
result_type shark::MultiVariateNormalDistributionCholesky::operator() ( RngType &  rng) const
inline

Samples the distribution.

Returns a vector pair (y,z) where y=Lz and, L is the lower cholesky factor and z is a vector of normally distributed numbers. Thus y is the real sampled point.

Definition at line 218 of file MultiVariateNormalDistribution.h.

§ rankOneUpdate()

void shark::MultiVariateNormalDistributionCholesky::rankOneUpdate ( double  alpha,
double  beta,
RealVector const &  v 
)
inline

§ resize()

void shark::MultiVariateNormalDistributionCholesky::resize ( std::size_t  size)
inline

Resizes the distribution. Updates both eigenvectors and eigenvalues.

Parameters
[in]sizeThe new size of the distribution

Definition at line 169 of file MultiVariateNormalDistribution.h.

References shark::size().

Referenced by shark::CMAChromosome::CMAChromosome().

§ serialize()

template<typename Archive >
void shark::MultiVariateNormalDistributionCholesky::serialize ( Archive &  ar,
const std::size_t  version 
)
inline

Stores/Restores the distribution from the supplied archive.

Parameters
[in,out]arThe archive to read from/write to.
[in]versionCurrently unused.

Definition at line 163 of file MultiVariateNormalDistribution.h.

§ setCovarianceMatrix()

void shark::MultiVariateNormalDistributionCholesky::setCovarianceMatrix ( RealMatrix const &  matrix)
inline

Sets the new covariance matrix by computing the new cholesky dcomposition.

Definition at line 179 of file MultiVariateNormalDistribution.h.

References shark::blas::choleskyDecomposition().

§ size()

std::size_t shark::MultiVariateNormalDistributionCholesky::size ( ) const
inline

Returns the size of the created vectors.

Definition at line 174 of file MultiVariateNormalDistribution.h.


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