SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdistmulti.DirichletDist Class Reference

Implements the abstract class ContinuousDistributionMulti for the Dirichlet distribution with parameters ( \(\alpha_1\),…, \(\alpha_d\)), \(\alpha_i > 0\). More...

Inheritance diagram for umontreal.ssj.probdistmulti.DirichletDist:
umontreal.ssj.probdistmulti.ContinuousDistributionMulti

Public Member Functions

double density (double[] x)
 Returns \(f(x_1, x_2, …, x_d)\), the probability density of \(X\) evaluated at the point \(x\), where \(x = \{x_1, x_2, …, x_d\}\).
double[] getMean ()
 Returns the mean vector of the distribution, defined as \(\mu_i = E[X_i]\).
double[][] getCovariance ()
 Returns the variance-covariance matrix of the distribution, defined as
\(\sigma_{ij} = E[(X_i - \mu_i)(X_j - \mu_j)]\).
double[][] getCorrelation ()
 Returns the correlation matrix of the distribution, defined as.
double[] getAlpha ()
 Returns the parameters ( \(\alpha_1\), …, \(\alpha_d\)) of this object.
double getAlpha (int i)
 Returns the \(i\)th component of the alpha vector.
void setParams (double[] alpha)
 Sets the parameters ( \(\alpha_1\), …, \(\alpha_d\)) of this object.
Public Member Functions inherited from umontreal.ssj.probdistmulti.ContinuousDistributionMulti
int getDimension ()
 Returns the dimension \(d\) of the distribution.

Static Public Member Functions

static double density (double[] alpha, double[] x)
 Computes the density ( fDirichlet ) of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).
static double[][] getCovariance (double[] alpha)
 Computes the covariance matrix of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).
static double[][] getCorrelation (double[] alpha)
 Computes the correlation matrix of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).
static double[] getMLE (double[][] x, int n, int d)
 Estimates the parameters [ \(\hat{\alpha_1},…,\hat{\alpha_d}\)] of the Dirichlet distribution using the maximum likelihood method.
static double[] getMean (double[] alpha)
 Computes the mean \(E[X] = \alpha_i / \alpha_0\) of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)), where.

Detailed Description

Implements the abstract class ContinuousDistributionMulti for the Dirichlet distribution with parameters ( \(\alpha_1\),…, \(\alpha_d\)), \(\alpha_i > 0\).

The probability density is

\[ f(x_1,…, x_d) = \frac{\Gamma(\alpha_0) \prod_{i=1}^d x_i^{\alpha_i - 1}}{\prod_{i=1}^d \Gamma(\alpha_i)} \tag{fDirichlet} \]

where \(x_i \ge0\), \(\sum_{i=1}^d x_i = 1\), \(\alpha_0 = \sum_{i=1}^d \alpha_i\), and \(\Gamma\) is the Gamma function.

Definition at line 46 of file DirichletDist.java.

Member Function Documentation

◆ density() [1/2]

double umontreal.ssj.probdistmulti.DirichletDist.density ( double[] alpha,
double[] x )
static

Computes the density ( fDirichlet ) of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).

Definition at line 138 of file DirichletDist.java.

◆ density() [2/2]

double umontreal.ssj.probdistmulti.DirichletDist.density ( double[] x)

Returns \(f(x_1, x_2, …, x_d)\), the probability density of \(X\) evaluated at the point \(x\), where \(x = \{x_1, x_2, …, x_d\}\).

The convention is that \(\mathtt{x[i-1]} = x_i\).

Parameters
xvalue at which the density is evaluated
Returns
density function evaluated at x

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.

Definition at line 90 of file DirichletDist.java.

◆ getAlpha() [1/2]

double[] umontreal.ssj.probdistmulti.DirichletDist.getAlpha ( )

Returns the parameters ( \(\alpha_1\), …, \(\alpha_d\)) of this object.

Definition at line 303 of file DirichletDist.java.

◆ getAlpha() [2/2]

double umontreal.ssj.probdistmulti.DirichletDist.getAlpha ( int i)

Returns the \(i\)th component of the alpha vector.

Definition at line 310 of file DirichletDist.java.

◆ getCorrelation() [1/2]

double[][] umontreal.ssj.probdistmulti.DirichletDist.getCorrelation ( )

Returns the correlation matrix of the distribution, defined as.

\(\rho_{ij} = \sigma_{ij}/\sqrt{\sigma_{ii}\sigma_{jj}}\).

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.

Definition at line 102 of file DirichletDist.java.

◆ getCorrelation() [2/2]

double[][] umontreal.ssj.probdistmulti.DirichletDist.getCorrelation ( double[] alpha)
static

Computes the correlation matrix of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).

Definition at line 189 of file DirichletDist.java.

◆ getCovariance() [1/2]

double[][] umontreal.ssj.probdistmulti.DirichletDist.getCovariance ( )

Returns the variance-covariance matrix of the distribution, defined as
\(\sigma_{ij} = E[(X_i - \mu_i)(X_j - \mu_j)]\).

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.

Definition at line 98 of file DirichletDist.java.

◆ getCovariance() [2/2]

double[][] umontreal.ssj.probdistmulti.DirichletDist.getCovariance ( double[] alpha)
static

Computes the covariance matrix of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).

Definition at line 164 of file DirichletDist.java.

◆ getMean() [1/2]

double[] umontreal.ssj.probdistmulti.DirichletDist.getMean ( )

Returns the mean vector of the distribution, defined as \(\mu_i = E[X_i]\).

Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.

Definition at line 94 of file DirichletDist.java.

◆ getMean() [2/2]

double[] umontreal.ssj.probdistmulti.DirichletDist.getMean ( double[] alpha)
static

Computes the mean \(E[X] = \alpha_i / \alpha_0\) of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)), where.

\(\alpha_0 = \sum_{i=1}^d \alpha_i\).

Definition at line 295 of file DirichletDist.java.

◆ getMLE()

double[] umontreal.ssj.probdistmulti.DirichletDist.getMLE ( double x[][],
int n,
int d )
static

Estimates the parameters [ \(\hat{\alpha_1},…,\hat{\alpha_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\). The equations of the maximum likelihood are defined in [11]  (Technical appendix)

\begin{align*} L(\hat{\alpha}_1,\hat{\alpha}_2,…,\hat{\alpha}_k) & = n \left( G(\alpha_0) - \sum_{i=1}^k G(\hat{\alpha}_i) \right) + \sum_{i=1}^k (\hat{\alpha}_i - 1) Z_i \end{align*}

where \(G\) is the logarithm of the gamma function and

\begin{align*} \alpha_0 & = \sum_{i=1}^k \hat{\alpha}_i \\ Z_i & = \sum_{j=1}^n \ln(X_{i,j}) \qquad\mbox{for }i=1,…,k. \end{align*}

Parameters
xthe list of observations to use to evaluate parameters
nthe number of observations to use to evaluate parameters
dthe dimension of each vector
Returns
returns the parameter [ \(\hat{\alpha_1},…,\hat{\alpha_d}\)]

Definition at line 214 of file DirichletDist.java.

◆ setParams()

void umontreal.ssj.probdistmulti.DirichletDist.setParams ( double[] alpha)

Sets the parameters ( \(\alpha_1\), …, \(\alpha_d\)) of this object.

Definition at line 317 of file DirichletDist.java.


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