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

Implements the class DiscreteDistributionIntMulti for the negative multinomial distribution with parameters \(n > 0\) and ( \(p_1, …, p_d\)) such that all \(0<p_i<1\) and \(\sum_{i=1}^d p_i < 1\). More...

Inheritance diagram for umontreal.ssj.probdistmulti.NegativeMultinomialDist:
umontreal.ssj.probdistmulti.DiscreteDistributionIntMulti

Public Member Functions

 NegativeMultinomialDist (double n, double p[])
 Creates a NegativeMultinomialDist object with parameters \(n\) and ( \(p_1\), …, \(p_d\)) such that \(\sum_{i=1}^d p_i < 1\), as described above.
double prob (int x[])
 Returns the probability mass function \(p(x_1, x_2, …, x_d)\), which should be a real number in \([0,1]\).
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 getGamma ()
 Returns the parameter \(n\) of this object.
double[] getP ()
 Returns the parameters ( \(p_1\), …, \(p_d\)) of this object.
void setParams (double n, double p[])
 Sets the parameters \(n\) and ( \(p_1\), …, \(p_d\)) of this object.
Public Member Functions inherited from umontreal.ssj.probdistmulti.DiscreteDistributionIntMulti
double cdf (int x[])
 Computes the cumulative probability function \(F\) of the distribution evaluated at x, assuming the lowest values start at 0, i.e.
int getDimension ()
 Returns the dimension \(d\) of the distribution.

Static Public Member Functions

static double prob (double n, double p[], int x[])
 Computes the probability mass function ( fNegativeMultinomial ) of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)), evaluated at.
static double cdf (double n, double p[], int x[])
 Computes the cumulative probability function \(F\) of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_k\)), evaluated at \(\mathbf{x}\).
static double[] getMean (double n, double p[])
 Computes the mean \(E[X] = n p_i / p_0\) of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)).
static double[][] getCovariance (double n, double p[])
 Computes the covariance matrix of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)).
static double[][] getCorrelation (double n, double[] p)
 Computes the correlation matrix of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)).
static double[] getMLE (int x[][], int m, int d)
 Estimates and returns the parameters [ \(\hat{n}\),.
static double getMLEninv (int x[][], int m, int d)
 Estimates and returns the parameter \(\nu= 1/\hat{n}\) of the negative multinomial distribution using the maximum likelihood method.

Detailed Description

Implements the class DiscreteDistributionIntMulti for the negative multinomial distribution with parameters \(n > 0\) and ( \(p_1, …, p_d\)) such that all \(0<p_i<1\) and \(\sum_{i=1}^d p_i < 1\).

The probability mass function is [93]

\[ P[X = (x_1, …,x_d)] = \frac{\Gamma\left(n + \sum_{i=1}^d x_i\right) p_0^n}{\Gamma(n)} \prod_{i=1}^d \frac{p_i^{x_i}}{x_i!} \tag{fNegativeMultinomial} \]

where \(p_0 = 1 - \sum_{i=1}^d p_i\).

Definition at line 47 of file NegativeMultinomialDist.java.

Constructor & Destructor Documentation

◆ NegativeMultinomialDist()

umontreal.ssj.probdistmulti.NegativeMultinomialDist.NegativeMultinomialDist ( double n,
double p[] )

Creates a NegativeMultinomialDist object with parameters \(n\) and ( \(p_1\), …, \(p_d\)) such that \(\sum_{i=1}^d p_i < 1\), as described above.

We have \(p_i = \) p[i-1].

Definition at line 99 of file NegativeMultinomialDist.java.

Member Function Documentation

◆ cdf()

double umontreal.ssj.probdistmulti.NegativeMultinomialDist.cdf ( double n,
double p[],
int x[] )
static

Computes the cumulative probability function \(F\) of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_k\)), evaluated at \(\mathbf{x}\).

Definition at line 182 of file NegativeMultinomialDist.java.

◆ getCorrelation() [1/2]

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

Returns the correlation matrix of the distribution, defined as.

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

Reimplemented from umontreal.ssj.probdistmulti.DiscreteDistributionIntMulti.

Definition at line 119 of file NegativeMultinomialDist.java.

◆ getCorrelation() [2/2]

double[][] umontreal.ssj.probdistmulti.NegativeMultinomialDist.getCorrelation ( double n,
double[] p )
static

Computes the correlation matrix of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)).

Definition at line 263 of file NegativeMultinomialDist.java.

◆ getCovariance() [1/2]

double[][] umontreal.ssj.probdistmulti.NegativeMultinomialDist.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.DiscreteDistributionIntMulti.

Definition at line 115 of file NegativeMultinomialDist.java.

◆ getCovariance() [2/2]

double[][] umontreal.ssj.probdistmulti.NegativeMultinomialDist.getCovariance ( double n,
double p[] )
static

Computes the covariance matrix of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)).

Definition at line 236 of file NegativeMultinomialDist.java.

◆ getGamma()

double umontreal.ssj.probdistmulti.NegativeMultinomialDist.getGamma ( )

Returns the parameter \(n\) of this object.

Definition at line 437 of file NegativeMultinomialDist.java.

◆ getMean() [1/2]

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

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

Reimplemented from umontreal.ssj.probdistmulti.DiscreteDistributionIntMulti.

Definition at line 111 of file NegativeMultinomialDist.java.

◆ getMean() [2/2]

double[] umontreal.ssj.probdistmulti.NegativeMultinomialDist.getMean ( double n,
double p[] )
static

Computes the mean \(E[X] = n p_i / p_0\) of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)).

Definition at line 207 of file NegativeMultinomialDist.java.

◆ getMLE()

double[] umontreal.ssj.probdistmulti.NegativeMultinomialDist.getMLE ( int x[][],
int m,
int d )
static

Estimates and returns the parameters [ \(\hat{n}\),.

\(\hat{p}_1\), …, \(\hat{p}_d\)] of the negative multinomial distribution using the maximum likelihood method. It uses the \(m\) observations of \(d\) components in table x[ \(i\)][ \(j\)], \(i = 0, 1, …, m-1\) and \(j = 0, 1, …, d-1\). The equations of the maximum likelihood are defined in [93] :

\begin{align*} \sum_{s=1}^M \frac{F_s}{(\hat{n} + s - 1)} & = \ln\left(1 + \frac{1}{\hat{n} m} \sum_{j=1}^m \Upsilon_j \right) \\ p_i & = \frac{\lambda_i}{1 + \sum_{j=1}^d \lambda_j} \qquad\mbox{for } i=1, …,d \end{align*}

where

\begin{align*} \lambda_i & = \frac{\sum_{j=1}^m X_{i,j}}{\hat{n} m} \qquad\mbox{for } i=1, …,d \\ \Upsilon_j & = \sum_{i=1}^d X_{i,j} \qquad\mbox{for } j=1, …,m \\ F_s & = \frac{1}{m} \sum_{j=1}^m \mbox{\textbf{1}}\{\Upsilon_j \ge s\} \qquad\mbox{for } s=1, …,M \\ M & = \max_j \{\Upsilon_j\} \end{align*}

Parameters
xthe list of observations used to evaluate parameters
mthe number of observations used to evaluate parameters
dthe dimension of each vector
Returns
returns the parameters [ \(\hat{n}\), \(\hat{p}_1\), …, \(\hat{p}_d\)]

Definition at line 295 of file NegativeMultinomialDist.java.

◆ getMLEninv()

double umontreal.ssj.probdistmulti.NegativeMultinomialDist.getMLEninv ( int x[][],
int m,
int d )
static

Estimates and returns the parameter \(\nu= 1/\hat{n}\) of the negative multinomial distribution using the maximum likelihood method.

It uses the \(m\) observations of \(d\) components in table x[ \(i\)][ \(j\)], \(i = 0, 1, …, m-1\) and \(j = 0, 1, …, d-1\). The equation of maximum likelihood is defined as:

\[ \sum_{s=1}^M \frac{\nu F_s}{(1 + \nu(s - 1))} = \ln\left(1 + \frac{\nu}{m} \sum_{j=1}^m \Upsilon_j \right)\\ \]

where the symbols are defined as in getMLE(int[][],int,int).

Parameters
xthe list of observations used to evaluate parameters
mthe number of observations used to evaluate parameters
dthe dimension of each vector
Returns
returns the parameter \(1/\hat{n}\)

Definition at line 387 of file NegativeMultinomialDist.java.

◆ getP()

double[] umontreal.ssj.probdistmulti.NegativeMultinomialDist.getP ( )

Returns the parameters ( \(p_1\), …, \(p_d\)) of this object.

Definition at line 444 of file NegativeMultinomialDist.java.

◆ prob() [1/2]

double umontreal.ssj.probdistmulti.NegativeMultinomialDist.prob ( double n,
double p[],
int x[] )
static

Computes the probability mass function ( fNegativeMultinomial ) of the negative multinomial distribution with parameters \(n\) and ( \(p_1\), …, \(p_d\)), evaluated at.

\(\mathbf{x}\).

Definition at line 168 of file NegativeMultinomialDist.java.

◆ prob() [2/2]

double umontreal.ssj.probdistmulti.NegativeMultinomialDist.prob ( int x[])

Returns the probability mass function \(p(x_1, x_2, …, x_d)\), which should be a real number in \([0,1]\).

Parameters
xvalue at which the mass function must be evaluated
Returns
the mass function evaluated at x

Reimplemented from umontreal.ssj.probdistmulti.DiscreteDistributionIntMulti.

Definition at line 103 of file NegativeMultinomialDist.java.

◆ setParams()

void umontreal.ssj.probdistmulti.NegativeMultinomialDist.setParams ( double n,
double p[] )

Sets the parameters \(n\) and ( \(p_1\), …, \(p_d\)) of this object.

Definition at line 451 of file NegativeMultinomialDist.java.


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