jMEF.UnivariateGaussian Class Reference

List of all members.

Public Member Functions

double F (PVector T)
 Computes the log normalizer $ F( \mathbf{\Theta} ) $.
PVector gradF (PVector T)
 Computes $ \nabla F ( \mathbf{\Theta} )$.
double G (PVector H)
 Computes $ G(\mathbf{H})$.
PVector gradG (PVector H)
 Computes $ \nabla G (\mathbf{H})$.
PVector t (PVector x)
 Computes the sufficient statistic $ t(x)$.
double k (PVector x)
 Computes the carrier measure $ k(x) $.
PVector Lambda2Theta (PVector L)
 Converts source parameters to natural parameters.
PVector Theta2Lambda (PVector T)
 Converts natural parameters to source parameters.
PVector Lambda2Eta (PVector L)
 Converts source parameters to expectation parameters.
PVector Eta2Lambda (PVector H)
 Converts expectation parameters to source parameters.
double density (PVector x, PVector param)
 Computes the density value $ f(x;\mu,\sigma^2) $.
PVector drawRandomPoint (PVector L)
 Draws a point from the considered distribution.
double KLD (PVector LP, PVector LQ)
 Computes the Kullback-Leibler divergence between two univariate Gaussian distributions.

Static Public Member Functions

static double Rand (double mu, double sigma)
 Box-Muller transform/generator.
static double Rand ()
 Box-Muller transform/generator.


Detailed Description

Author:
Vincent Garcia

Frank Nielsen

Version:
1.0

License

See file LICENSE.txt

Description

The univariate Gaussian distribution is an exponential family and, as a consequence, the probability density function is given by

\[ f(x; \mathbf{\Theta}) = \exp \left( \langle t(x), \mathbf{\Theta} \rangle - F(\mathbf{\Theta}) + k(x) \right) \]

where $ \mathbf{\Theta} $ are the natural parameters. This class implements the different functions allowing to express a univariate Gaussian distribution as a member of an exponential family.

Parameters

The parameters of a given distribution are:

Member Function Documentation

double jMEF.UnivariateGaussian.density ( PVector  x,
PVector  param 
)

Computes the density value $ f(x;\mu,\sigma^2) $.

Parameters:
x point
param parameters (source, natural, or expectation)
Returns:
$ f(x;\mu,\sigma^2) = \frac{1}{ \sqrt{2\pi \sigma^2} } \exp \left( - \frac{(x-\mu)^2}{ 2 \sigma^2} \right) $

PVector jMEF.UnivariateGaussian.drawRandomPoint ( PVector  L  ) 

Draws a point from the considered distribution.

Parameters:
L source parameters $ \mathbf{\Lambda} = ( \mu , \sigma^2 )$
Returns:
a point

PVector jMEF.UnivariateGaussian.Eta2Lambda ( PVector  H  ) 

Converts expectation parameters to source parameters.

Parameters:
H natural parameters $ \mathbf{H} = ( \eta_1 , \eta_2 )$
Returns:
source parameters $ \mathbf{\Lambda} = \left( \eta_1 , \eta_2 - \eta_1^2 \right) $

double jMEF.UnivariateGaussian.F ( PVector  T  ) 

Computes the log normalizer $ F( \mathbf{\Theta} ) $.

Parameters:
T parameters $ \mathbf{\Theta} = ( \theta_1 , \theta_2 ) $
Returns:
$ F(\mathbf{\Theta}) = -\frac{\theta_1^2}{4\theta_2} + \frac{1}{2} \log \left( -\frac{\pi}{\theta_2} \right) $

double jMEF.UnivariateGaussian.G ( PVector  H  ) 

Computes $ G(\mathbf{H})$.

Parameters:
H expectation parameters $ \mathbf{H} = ( \eta_1 , \eta_2 ) $
Returns:
$ G(\mathbf{H}) = - \frac{1}{2} \log ( \eta_1^2 - \eta_2 ) $

PVector jMEF.UnivariateGaussian.gradF ( PVector  T  ) 

Computes $ \nabla F ( \mathbf{\Theta} )$.

Parameters:
T natural parameters $ \mathbf{\Theta} = ( \theta_1 , \theta_2 ) $
Returns:
$ \nabla F(\mathbf{\Theta}) = \left( -\frac{\theta_1}{2 \theta_2} , -\frac{1}{2 \theta_2} + \frac{\theta_1^2}{4 \theta_2^2} \right) $

PVector jMEF.UnivariateGaussian.gradG ( PVector  H  ) 

Computes $ \nabla G (\mathbf{H})$.

Parameters:
H expectation parameters $ \mathbf{H} = ( \eta_1 , \eta_2) $
Returns:
$ \nabla G(\mathbf{H}) = \left( -\frac{\eta_1}{\eta_1^2-\eta_2} , \frac{1}{2 (\eta_1^2-\eta_2)} \right) $

double jMEF.UnivariateGaussian.k ( PVector  x  ) 

Computes the carrier measure $ k(x) $.

Parameters:
x a point
Returns:
$ k(x) = 0 $

double jMEF.UnivariateGaussian.KLD ( PVector  LP,
PVector  LQ 
)

Computes the Kullback-Leibler divergence between two univariate Gaussian distributions.

Parameters:
LP source parameters $ \mathbf{\Lambda}_P $
LQ source parameters $ \mathbf{\Lambda}_Q $
Returns:
$ D_{\mathrm{KL}}(f_P\|f_Q) = \frac{1}{2} \left( 2 \log \frac{\sigma_Q}{\sigma_P} + \frac{\sigma_P^2}{\sigma_Q^2} + \frac{(\mu_Q-\mu_P)^2}{\sigma_Q^2} -1\right) $

PVector jMEF.UnivariateGaussian.Lambda2Eta ( PVector  L  ) 

Converts source parameters to expectation parameters.

Parameters:
L source parameters $ \mathbf{\Lambda} = ( \mu , \sigma^2 )$
Returns:
expectation parameters $ \mathbf{H} = \left( \mu , \sigma^2 + \mu^2 \right) $

PVector jMEF.UnivariateGaussian.Lambda2Theta ( PVector  L  ) 

Converts source parameters to natural parameters.

Parameters:
L source parameters $ \mathbf{\Lambda} = ( \mu , \sigma^2 )$
Returns:
natural parameters $ \mathbf{\Theta} = \left( \frac{\mu}{\sigma^2} , -\frac{1}{2\sigma^2} \right) $

static double jMEF.UnivariateGaussian.Rand (  )  [static]

Box-Muller transform/generator.

Returns:
$ \sqrt{ -2 \log ( x ) } \cos (2 \pi x) $ where $ x \in \mathcal{U}(0,1)$

static double jMEF.UnivariateGaussian.Rand ( double  mu,
double  sigma 
) [static]

Box-Muller transform/generator.

Parameters:
mu mean $ \mu $
sigma variance $ \sigma $
Returns:
$ \mu + \sigma \sqrt{ -2 \log ( x ) } \cos (2 \pi x) $ where $ x \in \mathcal{U}(0,1)$

PVector jMEF.UnivariateGaussian.t ( PVector  x  ) 

Computes the sufficient statistic $ t(x)$.

Parameters:
x a point
Returns:
$ t(x) = (x , x^2) $

PVector jMEF.UnivariateGaussian.Theta2Lambda ( PVector  T  ) 

Converts natural parameters to source parameters.

Parameters:
T natural parameters $ \mathbf{\Theta} = ( \theta_1 , \theta_2 )$
Returns:
source parameters $ \mathbf{\Lambda} = \left( -\frac{\theta_1}{2 \theta_2} , -\frac{1}{2 \theta_2} \right) $


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

Generated on Mon Nov 23 15:46:26 2009 for jMEF by  doxygen 1.5.9