Implements the abstract class ContinuousDistributionMulti for the Dirichlet distribution with parameters ( \(\alpha_1\),…, \(\alpha_d\)), \(\alpha_i > 0\). More...
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. | |
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.
|
static |
Computes the density ( fDirichlet ) of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).
Definition at line 138 of file DirichletDist.java.
| 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\).
| x | value at which the density is evaluated |
Reimplemented from umontreal.ssj.probdistmulti.ContinuousDistributionMulti.
Definition at line 90 of file DirichletDist.java.
| double[] umontreal.ssj.probdistmulti.DirichletDist.getAlpha | ( | ) |
Returns the parameters ( \(\alpha_1\), …, \(\alpha_d\)) of this object.
Definition at line 303 of file DirichletDist.java.
| 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.
| 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.
|
static |
Computes the correlation matrix of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).
Definition at line 189 of file DirichletDist.java.
| 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.
|
static |
Computes the covariance matrix of the Dirichlet distribution with parameters ( \(\alpha_1\), …, \(\alpha_d\)).
Definition at line 164 of file DirichletDist.java.
| 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.
|
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.
|
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*}
| 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 |
Definition at line 214 of file DirichletDist.java.
| 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.