umontreal.iro.lecuyer.probdistmulti
Class NegativeMultinomialDist
- java.lang.Object
-
- umontreal.iro.lecuyer.probdistmulti.DiscreteDistributionIntMulti
-
- umontreal.iro.lecuyer.probdistmulti.NegativeMultinomialDist
-
public class NegativeMultinomialDist extends DiscreteDistributionIntMulti
Implements the abstract classDiscreteDistributionIntMultifor the negative multinomial distribution with parameters γ > 0 and ( p1,…, pd), such that all 0 < pi < 1 and ∑i=1dpi < 1. The probability mass function isP[X = (x1,…, xd)] = (Γ(γ+∑i=1dxi)/Γ(γ)∏i=1dxi!)p0γ∏i=1dpixiwhere p0 = 1 - ∑i=1dpi.
-
-
Constructor Summary
Constructors Constructor and Description NegativeMultinomialDist(double gamma, double[] p)Creates a NegativeMultinomialDist object with parameters γ = gamma and (p1,...,pd) such that ∑i=1dpi < 1, as described above.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description static doublecdf(double gamma, double[] p, int[] x)Computes the cumulative probability function F of the negative multinomial distribution with parameters γ and (p1,...,pk), evaluated at x.double[][]getCorrelation()Returns the correlation matrix of the distribution, defined as ρij = σij/(σ_iiσ_jj)1/2.static double[][]getCorrelation(double gamma, double[] p)Computes the correlation matrix of the negative multinomial distribution with parameters γ and (p1,...,pd).double[][]getCovariance()Returns the variance-covariance matrix of the distribution, defined as
σij = E[(Xi - μi)(Xj - μj)].static double[][]getCovariance(double gamma, double[] p)Computes the covariance matrix of the negative multinomial distribution with parameters γ and (p1,...,pd).doublegetGamma()Returns the parameter γ of this object.static double[]getMaximumLikelihoodEstimate(int[][] x, int n, int d)Deprecated.double[]getMean()Returns the mean vector of the distribution, defined as μi = E[Xi].static double[]getMean(double gamma, double[] p)Computes the mean E[X] = γpi/p0 of the negative multinomial distribution with parameters γ and (p1,...,pd).static double[]getMLE(int[][] x, int n, int d)Estimates and returns the parameters [ hat(γ), hat(p_1),..., hat(p_d)] of the negative multinomial distribution using the maximum likelihood method.double[]getP()Returns the parameters (p1,...,pd) of this object.static doubleprob(double gamma, double[] p, int[] x)Computes the probability mass function of the negative multinomial distribution with parameters γ and (p1,...,pd), evaluated at x.doubleprob(int[] x)Returns the probability mass function p(x1, x2,…, xd), which should be a real number in [0, 1].voidsetParams(double gamma, double[] p)Sets the parameters γ and (p1,...,pd) of this object.-
Methods inherited from class umontreal.iro.lecuyer.probdistmulti.DiscreteDistributionIntMulti
cdf, getDimension
-
-
-
-
Constructor Detail
-
NegativeMultinomialDist
public NegativeMultinomialDist(double gamma, double[] p)Creates a NegativeMultinomialDist object with parameters γ = gamma and (p1,...,pd) such that ∑i=1dpi < 1, as described above. We have pi = p[i-1].
-
-
Method Detail
-
prob
public double prob(int[] x)
Description copied from class:DiscreteDistributionIntMultiReturns the probability mass function p(x1, x2,…, xd), which should be a real number in [0, 1].- Specified by:
probin classDiscreteDistributionIntMulti- Parameters:
x- value at which the mass function must be evaluated- Returns:
- the mass function evaluated at x
-
getMean
public double[] getMean()
Description copied from class:DiscreteDistributionIntMultiReturns the mean vector of the distribution, defined as μi = E[Xi].- Specified by:
getMeanin classDiscreteDistributionIntMulti
-
getCovariance
public double[][] getCovariance()
Description copied from class:DiscreteDistributionIntMultiReturns the variance-covariance matrix of the distribution, defined as
σij = E[(Xi - μi)(Xj - μj)].- Specified by:
getCovariancein classDiscreteDistributionIntMulti
-
getCorrelation
public double[][] getCorrelation()
Description copied from class:DiscreteDistributionIntMultiReturns the correlation matrix of the distribution, defined as ρij = σij/(σ_iiσ_jj)1/2.- Specified by:
getCorrelationin classDiscreteDistributionIntMulti
-
prob
public static double prob(double gamma, double[] p, int[] x)Computes the probability mass function of the negative multinomial distribution with parameters γ and (p1,...,pd), evaluated at x.
-
cdf
public static double cdf(double gamma, double[] p, int[] x)Computes the cumulative probability function F of the negative multinomial distribution with parameters γ and (p1,...,pk), evaluated at x.
-
getMean
public static double[] getMean(double gamma, double[] p)Computes the mean E[X] = γpi/p0 of the negative multinomial distribution with parameters γ and (p1,...,pd).
-
getCovariance
public static double[][] getCovariance(double gamma, double[] p)Computes the covariance matrix of the negative multinomial distribution with parameters γ and (p1,...,pd).
-
getCorrelation
public static double[][] getCorrelation(double gamma, double[] p)Computes the correlation matrix of the negative multinomial distribution with parameters γ and (p1,...,pd).
-
getMaximumLikelihoodEstimate
@Deprecated public static double[] getMaximumLikelihoodEstimate(int[][] x, int n, int d)Deprecated.It is now called getMLE.
-
getMLE
public static double[] getMLE(int[][] x, int n, int d)Estimates and returns the parameters [ hat(γ), hat(p_1),..., hat(p_d)] of the negative multinomial 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 used to evaluate parametersn- the number of observations used to evaluate parametersd- the dimension of each vector- Returns:
- returns the parameters [ hat(γ), hat(p_1),...,hat(p_d)]
-
getGamma
public double getGamma()
Returns the parameter γ of this object.
-
getP
public double[] getP()
Returns the parameters (p1,...,pd) of this object.
-
setParams
public void setParams(double gamma, double[] p)Sets the parameters γ and (p1,...,pd) of this object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG