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.
 
 MultiVariateNormalDistributionCholesky ()
 
template<typename Archive >
void serialize (Archive &ar, const std::size_t version)
 Stores/Restores the distribution from the supplied archive.
 
void resize (std::size_t size)
 Resizes the distribution. Updates both eigenvectors and eigenvalues.
 
std::size_t size () const
 Returns the size of the created vectors.
 
blas::matrix< double, blas::column_major > const & lowerCholeskyFactor () const
 Returns the matrix holding the lower cholesky factor A.
 
void setCovarianceMatrix (RealMatrix const &matrix)
 Sets the new covariance matrix by computing the new cholesky dcomposition.
 
void rankOneUpdate (double alpha, double beta, RealVector const &v)
 Updates the covariance matrix of the distribution to C<- alpha*C+beta * vv^T.
 
template<class randomType , class Vector1 , class Vector2 >
void generate (randomType &rng, Vector1 &y, Vector2 &z) const
 
template<class randomType >
result_type operator() (randomType &rng) const
 Samples the distribution.
 

Detailed Description

Multivariate normal distribution with zero mean using a cholesky decomposition.

Definition at line 129 of file MultiVariateNormalDistribution.h.

Constructor & Destructor Documentation

◆ MultiVariateNormalDistributionCholesky() [1/2]

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

Constructor.

Parameters
[in]covarianceCovariance matrix.

Definition at line 140 of file MultiVariateNormalDistribution.h.

References shark::covariance(), and setCovarianceMatrix().

◆ MultiVariateNormalDistributionCholesky() [2/2]

shark::MultiVariateNormalDistributionCholesky::MultiVariateNormalDistributionCholesky ( )
inline

Definition at line 144 of file MultiVariateNormalDistribution.h.

Member Function Documentation

◆ generate()

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

◆ lowerCholeskyFactor()

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

Returns the matrix holding the lower cholesky factor A.

Definition at line 166 of file MultiVariateNormalDistribution.h.

Referenced by shark::CMSA::eigenValues().

◆ operator()()

template<class randomType >
result_type shark::MultiVariateNormalDistributionCholesky::operator() ( randomType &  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.

Parameters
[in]rngRandom number generator.

Definition at line 198 of file MultiVariateNormalDistribution.h.

References generate().

◆ rankOneUpdate()

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

Updates the covariance matrix of the distribution to C<- alpha*C+beta * vv^T.

Definition at line 177 of file MultiVariateNormalDistribution.h.

◆ 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 156 of file MultiVariateNormalDistribution.h.

References 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]arArchive to read from/write to.
[in]versionCurrently unused.

Definition at line 150 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 172 of file MultiVariateNormalDistribution.h.

Referenced by MultiVariateNormalDistributionCholesky(), and shark::NormalDistributedPoints::NormalDistributedPoints().

◆ size()

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

Returns the size of the created vectors.

Definition at line 161 of file MultiVariateNormalDistribution.h.

Referenced by generate(), and resize().


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