KLDivergence Class Reference

Helper methods for calculating Kullback-Leibler divergences. More...

#include <KLDivergence.h>

Public Member Functions

 KLDivergence ()
 
 ~KLDivergence ()
 
double distanceGaussian (const std::vector< double > &means1, const std::vector< double > &variances1, const std::vector< double > &means2, const std::vector< double > &variances2)
 Calculate a symmetrised Kullback-Leibler divergence of Gaussian models based on mean and variance vectors. More...
 
double distanceDistribution (const std::vector< double > &d1, const std::vector< double > &d2, bool symmetrised)
 Calculate a Kullback-Leibler divergence of two probability distributions. More...
 

Detailed Description

Helper methods for calculating Kullback-Leibler divergences.

Definition at line 23 of file KLDivergence.h.

Constructor & Destructor Documentation

KLDivergence::KLDivergence ( )
inline

Definition at line 26 of file KLDivergence.h.

KLDivergence::~KLDivergence ( )
inline

Definition at line 27 of file KLDivergence.h.

References distanceDistribution(), and distanceGaussian().

Member Function Documentation

double KLDivergence::distanceGaussian ( const std::vector< double > &  means1,
const std::vector< double > &  variances1,
const std::vector< double > &  means2,
const std::vector< double > &  variances2 
)

Calculate a symmetrised Kullback-Leibler divergence of Gaussian models based on mean and variance vectors.

All input vectors must be of equal size.

Definition at line 22 of file KLDivergence.cpp.

Referenced by ~KLDivergence().

double KLDivergence::distanceDistribution ( const std::vector< double > &  d1,
const std::vector< double > &  d2,
bool  symmetrised 
)

Calculate a Kullback-Leibler divergence of two probability distributions.

Input vectors must be of equal size. If symmetrised is true, the result will be the symmetrised distance (equal to KL(d1, d2) + KL(d2, d1)).

Definition at line 47 of file KLDivergence.cpp.

Referenced by ~KLDivergence().


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