umontreal.iro.lecuyer.probdistmulti
Class DirichletDist
- java.lang.Object
-
- umontreal.iro.lecuyer.probdistmulti.ContinuousDistributionMulti
-
- umontreal.iro.lecuyer.probdistmulti.DirichletDist
-
public class DirichletDist extends ContinuousDistributionMulti
Implements the abstract classContinuousDistributionMultifor the Dirichlet distribution with parameters (α1,...,αd), αi > 0. The probability density isP[X = (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
Constructors Constructor and Description DirichletDist(double[] alpha)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description doubledensity(double[] x)Returns f (x1, x2,…, xd), the probability density of X evaluated at the point x, where x = {x1, x2,…, xd}.static doubledensity(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.doublegetAlpha(int i)Returns the ith component of the alpha vector.double[][]getCorrelation()Returns the correlation matrix of the distribution, defined as ρij = σij/(σ_iiσ_jj)1/2.static double[][]getCorrelation(double[] alpha)Computes the correlation matrix of the Dirichlet distribution with parameters (α1,...,αd).double[][]getCovariance()Returns the variance-covariance matrix of the distribution, defined as
σij = E[(Xi - μi)(Xj - μj)].static double[][]getCovariance(double[] alpha)Computes the covariance matrix of the Dirichlet distribution with parameters (α1,...,αd).static double[]getMaximumLikelihoodEstimate(double[][] x, int n, int d)Deprecated.double[]getMean()Returns the mean vector of the distribution, defined as μi = E[Xi].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.voidsetParams(double[] alpha)Sets the parameters (α1,...,αd) of this object.-
Methods inherited from class umontreal.iro.lecuyer.probdistmulti.ContinuousDistributionMulti
getDimension
-
-
-
-
Method Detail
-
density
public double density(double[] x)
Description copied from class:ContinuousDistributionMultiReturns f (x1, x2,…, xd), the probability density of X evaluated at the point x, where x = {x1, x2,…, xd}. The convention is thatx [i -1 ] = xi.- Specified by:
densityin classContinuousDistributionMulti- Parameters:
x- value at which the density is evaluated- Returns:
- density function evaluated at x
-
getMean
public double[] getMean()
Description copied from class:ContinuousDistributionMultiReturns the mean vector of the distribution, defined as μi = E[Xi].- Specified by:
getMeanin classContinuousDistributionMulti
-
getCovariance
public double[][] getCovariance()
Description copied from class:ContinuousDistributionMultiReturns the variance-covariance matrix of the distribution, defined as
σij = E[(Xi - μi)(Xj - μj)].- Specified by:
getCovariancein classContinuousDistributionMulti
-
getCorrelation
public double[][] getCorrelation()
Description copied from class:ContinuousDistributionMultiReturns the correlation matrix of the distribution, defined as ρij = σij/(σ_iiσ_jj)1/2.- Specified by:
getCorrelationin classContinuousDistributionMulti
-
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).
-
getMaximumLikelihoodEstimate
@Deprecated public static double[] getMaximumLikelihoodEstimate(double[][] x, int n, int d)Deprecated.It is now called getMLE.
-
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 parametersn- the number of observations to use to evaluate parametersd- 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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG