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...
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. | |
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.
| 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.
|
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.
| 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.
|
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.
| 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.
|
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.
| double umontreal.ssj.probdistmulti.NegativeMultinomialDist.getGamma | ( | ) |
Returns the parameter \(n\) of this object.
Definition at line 437 of file NegativeMultinomialDist.java.
| 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.
|
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.
|
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*}
| x | the list of observations used to evaluate parameters |
| m | the number of observations used to evaluate parameters |
| d | the dimension of each vector |
Definition at line 295 of file NegativeMultinomialDist.java.
|
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).
| x | the list of observations used to evaluate parameters |
| m | the number of observations used to evaluate parameters |
| d | the dimension of each vector |
Definition at line 387 of file NegativeMultinomialDist.java.
| double[] umontreal.ssj.probdistmulti.NegativeMultinomialDist.getP | ( | ) |
Returns the parameters ( \(p_1\), …, \(p_d\)) of this object.
Definition at line 444 of file NegativeMultinomialDist.java.
|
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.
| 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]\).
| x | value at which the mass function must be evaluated |
Reimplemented from umontreal.ssj.probdistmulti.DiscreteDistributionIntMulti.
Definition at line 103 of file NegativeMultinomialDist.java.
| 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.