SSJ
V. labo.

umontreal.iro.lecuyer.probdistmulti
Class DirichletDist

java.lang.Object
  extended by umontreal.iro.lecuyer.probdistmulti.ContinuousDistributionMulti
      extended by umontreal.iro.lecuyer.probdistmulti.DirichletDist

public class DirichletDist
extends ContinuousDistributionMulti

Implements the abstract class ContinuousDistributionMulti for the Dirichlet distribution with parameters (α1,...,αd), αi > 0. The probability density is

f (x1,…, xd) = Γ(α0)∏i=1dxiαi-1/(∏i=1dΓ(αi))

where xi >=  0, i=1dxi = 1, α0 = ∑i=1dαi, and Γ is the Gamma function.


Constructor Summary
DirichletDist(double[] alpha)
           
 
Method Summary
 double density(double[] x)
          .
static double density(double[] alpha, double[] x)
          Computes the density of the Dirichlet distribution with parameters (α1, ..., αd).
 double[] getAlpha()
          Returns the parameters (α1, ..., αd) of this object.
 double getAlpha(int i)
          Returns the ith component of the alpha vector.
 double[][] getCorrelation()
          .
static double[][] getCorrelation(double[] alpha)
          Computes the correlation matrix of the Dirichlet distribution with parameters (α1, ..., αd).
 double[][] getCovariance()
          .
static double[][] getCovariance(double[] alpha)
          Computes the covariance matrix of the Dirichlet distribution with parameters (α1, ..., αd).
 double[] getMean()
          .
static double[] getMean(double[] alpha)
          Computes the mean E[X] = αi/α0 of the Dirichlet distribution with parameters (α1, ..., αd), where α0 = ∑i=1dαi.
static double[] getMLE(double[][] x, int n, int d)
          Estimates the parameters [ hat(α_1),…, hat(α_d)] of the Dirichlet distribution using the maximum likelihood method.
 void setParams(double[] alpha)
          Sets the parameters (α1, ..., αd) of this object.
 
Methods inherited from class umontreal.iro.lecuyer.probdistmulti.ContinuousDistributionMulti
getDimension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirichletDist

public DirichletDist(double[] alpha)
Method Detail

density

public double density(double[] x)
Description copied from class: ContinuousDistributionMulti
. \begin{tabb}Returns $f(x_1, x_2, \ldots, x_d)$, the probability density of
 $X$\...
 ..._2, \ldots, x_d\}$. The convention is that
 $\texttt{x[i-1]} = x_i$.
 \end{tabb}
xvalue at which the density is evaluated density function evaluated at x

Specified by:
density in class ContinuousDistributionMulti

getMean

public double[] getMean()
Description copied from class: ContinuousDistributionMulti
. \begin{tabb}
 Returns the mean vector of the distribution, defined as $\mu_{i} = E[X_i]$.
 \end{tabb}

Specified by:
getMean in class ContinuousDistributionMulti

getCovariance

public double[][] getCovariance()
Description copied from class: ContinuousDistributionMulti
. \begin{tabb}
 Returns the variance-covariance matrix of the distribution, defined as\\
 $\sigma_{ij} = E[(X_i - \mu_i)(X_j - \mu_j)]$.
 \end{tabb}

Specified by:
getCovariance in class ContinuousDistributionMulti

getCorrelation

public double[][] getCorrelation()
Description copied from class: ContinuousDistributionMulti
. \begin{tabb}
 Returns the correlation matrix of the distribution, defined as
 $\rho_{ij} = \sigma_{ij}/\sqrt{\sigma_{ii}\sigma_{jj}}$.
 \end{tabb}

Specified by:
getCorrelation in class ContinuousDistributionMulti

density

public static double density(double[] alpha,
                             double[] x)
Computes the density of the Dirichlet distribution with parameters (α1, ..., αd).


getCovariance

public static double[][] getCovariance(double[] alpha)
Computes the covariance matrix of the Dirichlet distribution with parameters (α1, ..., αd).


getCorrelation

public static double[][] getCorrelation(double[] alpha)
Computes the correlation matrix of the Dirichlet distribution with parameters (α1, ..., αd).


getMLE

public static double[] getMLE(double[][] x,
                              int n,
                              int d)
Estimates the parameters [ hat(α_1),…, hat(α_d)] of the Dirichlet distribution using the maximum likelihood method. It uses the n observations of d components in table x[i][j], i = 0, 1,…, n - 1 and j = 0, 1,…, d - 1.

Parameters:
x - the list of observations to use to evaluate parameters
n - the number of observations to use to evaluate parameters
d - the dimension of each vector
Returns:
returns the parameter [ hat(α_1),…, hat(α_d)]

getMean

public static double[] getMean(double[] alpha)
Computes the mean E[X] = αi/α0 of the Dirichlet distribution with parameters (α1, ..., αd), where α0 = ∑i=1dαi.


getAlpha

public double[] getAlpha()
Returns the parameters (α1, ..., αd) of this object.


getAlpha

public double getAlpha(int i)
Returns the ith component of the alpha vector.


setParams

public void setParams(double[] alpha)
Sets the parameters (α1, ..., αd) of this object.


SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.