jMEF.MultinomialFixedN Class Reference

List of all members.

Public Member Functions

 MultinomialFixedN ()
 Class constructor.
 MultinomialFixedN (int n)
 Class constructor.
double F (PVector T)
 Computes $ 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) $.
PVector drawRandomPoint (PVector L)
 Draws a point from the considered distribution.
double KLD (PVector LA, PVector LB)
 Computes the Kullback-Leibler divergence between two Binomial distributions.


Detailed Description

Author:
Vincent Garcia

Frank Nielsen

Version:
1.0

License

See file LICENSE.txt

Description

The Multinomial distribution, with $ n$ fixed, 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 Multinomial distribution as a member of an exponential family.

Parameters

The parameters of a given distribution are:

Constructor & Destructor Documentation

jMEF.MultinomialFixedN.MultinomialFixedN (  ) 

Class constructor.

jMEF.MultinomialFixedN.MultinomialFixedN ( int  n  ) 

Class constructor.

Parameters:
n parameter n


Member Function Documentation

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

Computes the density value $ f(x) $.

Parameters:
x point
param parameters (source, natural, or expectation)
Returns:
$ f(x_1,\cdots,x_k;p_1,\cdots,p_k,n) = \frac{n!}{x_1! \cdots x_k!} p_1^{x_1} \cdots p_k^{x_k} $

PVector jMEF.MultinomialFixedN.drawRandomPoint ( PVector  L  ) 

Draws a point from the considered distribution.

Parameters:
L source parameters $ \mathbf{\Lambda} = ( p_1, \cdots, p_k )$
Returns:
a point

PVector jMEF.MultinomialFixedN.Eta2Lambda ( PVector  H  ) 

Converts expectation parameters to source parameters.

Parameters:
H natural parameters $ \mathbf{H} = (\eta_1, \cdots, \eta_{k-1})$
Returns:
source parameters $ \mathbf{\Lambda} = \begin{cases} p_i = \frac{\eta_i}{n} & \mbox{if $i<k$}\\ p_k = \frac{n - \sum_{j=1}^{k-1} \eta_j}{n} \end{cases}$

double jMEF.MultinomialFixedN.F ( PVector  T  ) 

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

Parameters:
T parameters $ \mathbf{\Theta} = (\theta_1, \cdots, \theta_{k-1}) $
Returns:
$ F(\mathbf{\Theta}) = n \log \left( 1 + \sum_{i=1}^{k-1} \exp \theta_i \right) - \log n! $

double jMEF.MultinomialFixedN.G ( PVector  H  ) 

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

Parameters:
H expectation parameters $ \mathbf{H} = (\eta_1, \cdots, \eta_{k-1}) $
Returns:
$ G(\mathbf{H}) = \left( \sum_{i=1}^{k-1} \eta_i \log \eta_i \right) + \left( n - \sum_{i=1}^{k-1} \eta_i \right) \log \left( n - \sum_{i=1}^{k-1} \eta_i \right) $

PVector jMEF.MultinomialFixedN.gradF ( PVector  T  ) 

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

Parameters:
T naturel parameters $ \mathbf{\Theta} = (\theta_1, \cdots, \theta_{k-1}) $
Returns:
$ \nabla F( \mathbf{\Theta} ) = \left( \frac{n \exp \theta_i}{1 + \sum_{j=1}^{k-1} \exp \theta_j} \right)_i $

PVector jMEF.MultinomialFixedN.gradG ( PVector  H  ) 

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

Parameters:
H expectation parameters $ \mathbf{H} = (\eta_1, \cdots, \eta_{k-1}) $
Returns:
$ \nabla G( \mathbf{H} ) = \left( \log \left( \frac{\eta_i}{n - \sum_{j=1}^{k-1} \eta_j} \right) \right)_i $

double jMEF.MultinomialFixedN.k ( PVector  x  ) 

Computes the carrier measure $ k(x) $.

Parameters:
x a point
Returns:
$ k(x) = - \sum_{i=1}^{k} \log x_i ! $

double jMEF.MultinomialFixedN.KLD ( PVector  LA,
PVector  LB 
)

Computes the Kullback-Leibler divergence between two Binomial distributions.

Parameters:
LA source parameters $ \mathbf{\Lambda}_\alpha $
LB source parameters $ \mathbf{\Lambda}_\beta $
Returns:
$ D_{\mathrm{KL}}(f_1\|f_2) = n p_{\alpha,k} \log \frac{p_{\alpha,k}}{p_{\beta,k}} - n \sum_{i=1}^{k-1} p_{\alpha,i} \log \frac{p_{\beta,i}}{p_{\alpha,i}} $

PVector jMEF.MultinomialFixedN.Lambda2Eta ( PVector  L  ) 

Converts source parameters to expectation parameters.

Parameters:
L source parameters $ \mathbf{\Lambda} = ( p_1, \cdots, p_k )$
Returns:
expectation parameters $ \mathbf{H} = \left( n p_i \right)_i$

PVector jMEF.MultinomialFixedN.Lambda2Theta ( PVector  L  ) 

Converts source parameters to natural parameters.

Parameters:
L source parameters $ \mathbf{\Lambda} = (p_1, \cdots, p_k)$
Returns:
natural parameters $ \mathbf{\Theta} = \left( \log \left( \frac{p_i}{p_k} \right) \right)_i $

PVector jMEF.MultinomialFixedN.t ( PVector  x  ) 

Computes the sufficient statistic $ t(x)$.

Parameters:
x a point
Returns:
$ t(x) = (x_1, \cdots, x_{k-1}) $

PVector jMEF.MultinomialFixedN.Theta2Lambda ( PVector  T  ) 

Converts natural parameters to source parameters.

Parameters:
T natural parameters $ \mathbf{\Theta} = ( \theta_1, \cdots, \theta_{k-1} )$
Returns:
source parameters $ \mathbf{\Lambda} = \begin{cases} p_i = \frac{\exp \theta_i}{1 + \sum_{j=1}^{k-1}(\exp \theta_j)} & \mbox{if $i<k$}\\ p_k = \frac{1}{1 + \sum_{j=1}^{k-1}(\exp \theta_j)} \end{cases} $


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