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

The Pascal distribution is a special case of the negative binomial distribution [114]  (page 324) with parameters \(n\) and. More...

Inheritance diagram for umontreal.ssj.probdist.PascalDist:
umontreal.ssj.probdist.NegativeBinomialDist umontreal.ssj.probdist.DiscreteDistributionInt umontreal.ssj.probdist.Distribution

Public Member Functions

 PascalDist (int n, double p)
 Creates an object that contains the probability terms ( fmass-pascal ) and the distribution function for the Pascal distribution with parameter \(n\) and \(p\).
int getN1 ()
 Returns the parameter \(n\) of this object.
void setParams (int n, double p)
 Sets the parameter \(n\) and \(p\) of this object.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.NegativeBinomialDist
 NegativeBinomialDist (double n, double p)
 Creates an object that contains the probability terms ( fmass-negbin ) and the distribution function for the negative binomial distribution with parameters \(n\) and \(p\).
double prob (int x)
 Returns \(p(x)\), the probability of \(x\).
double cdf (int x)
 Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
double barF (int x)
 Returns \(\bar{F}(x)\), the complementary distribution function.
int inverseFInt (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), where.
double getMean ()
 Returns the mean of the distribution function.
double getVariance ()
 Returns the variance of the distribution function.
double getStandardDeviation ()
 Returns the standard deviation of the distribution function.
double getGamma ()
 Returns the parameter \(n\) of this object.
double getN ()
 Returns the parameter \(n\) of this object.
double getP ()
 Returns the parameter \(p\) of this object.
void setParams (double n, double p)
 Sets the parameter \(n\) and \(p\) of this object.
double[] getParams ()
 Return a table containing the parameters of the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.DiscreteDistributionInt
double cdf (double x)
 Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
double barF (double x)
 Returns \(\bar{F}(x)\), the complementary distribution function.
int getXinf ()
 Returns the lower limit \(x_a\) of the support of the probability mass function.
int getXsup ()
 Returns the upper limit \(x_b\) of the support of the probability mass function.
double inverseF (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), where.

Static Public Member Functions

static double[] getMLE (int[] x, int m)
 Estimates the parameter \((n, p)\) of the Pascal distribution using the maximum likelihood method, from the \(m\) observations.
static PascalDist getInstanceFromMLE (int[] x, int m)
 Creates a new instance of a Pascal distribution with parameters.
Static Public Member Functions inherited from umontreal.ssj.probdist.NegativeBinomialDist
static double prob (double n, double p, int x)
 Computes the probability \(p(x)\) defined in ( fmass-negbin ).
static double cdf (double n, double p, int x)
 Computes the distribution function.
static double barF (double n, double p, int x)
 Returns \(\bar{F}(x) = P[X \ge x]\), the complementary distribution function.
static int inverseF (double n, double p, double u)
 Computes the inverse function without precomputing tables.
static double[] getMLE (int[] x, int m, double n)
 Estimates the parameter \(p\) of the negative binomial distribution using the maximum likelihood method, from the \(m\) observations \(x[i]\), \(i = 0, 1, …, m-1\).
static NegativeBinomialDist getInstanceFromMLE (int[] x, int m, double n)
 Creates a new instance of a negative binomial distribution with parameters \(n\) given and \(\hat{p}\) estimated using the maximum likelihood method, from the \(m\) observations \(x[i]\),.
static double[] getMLE1 (int[] x, int m, double p)
 Estimates the parameter \(n\) of the negative binomial distribution using the maximum likelihood method, from the \(m\) observations \(x[i]\), \(i = 0, 1, …, m-1\).
static NegativeBinomialDist getInstanceFromMLE1 (int[] x, int m, double p)
 Creates a new instance of a negative binomial distribution with parameters \(p\) given and \(\hat{n}\) estimated using the maximum likelihood method, from the \(m\) observations \(x[i]\),.
static double getMLEninv (int[] x, int m)
 Estimates and returns the parameter \(\nu= 1/\hat{n}\) of the negative binomial distribution using the maximum likelihood method, from the \(m\) observations \(x[i]\), \(i = 0, 1, …, m-1\).
static double getMean (double n, double p)
 Computes and returns the mean \(E[X] = n(1 - p)/p\) of the negative binomial distribution with parameters \(n\) and \(p\).
static double getVariance (double n, double p)
 Computes and returns the variance \(\mbox{Var}[X] = n(1 - p)/p^2\) of the negative binomial distribution with parameters \(n\) and.
static double getStandardDeviation (double n, double p)
 Computes and returns the standard deviation of the negative binomial distribution with parameters \(n\) and \(p\).

Additional Inherited Members

Static Public Attributes inherited from umontreal.ssj.probdist.NegativeBinomialDist
static double MAXN = 100000
 If the maximum term is greater than this constant, then the tables will not be precomputed.
Static Public Attributes inherited from umontreal.ssj.probdist.DiscreteDistributionInt
static double EPSILON = 1.0e-16
 Environment variable that determines what probability terms can be considered as negligible when building precomputed tables for distribution and mass functions.

Detailed Description

The Pascal distribution is a special case of the negative binomial distribution [114]  (page 324) with parameters \(n\) and.

\(p\), where \(n\) is a positive integer and \(0\le p\le1\). Its mass function is

\[ p(x) = \binom{n + x - 1}{x} p^n (1 - p)^x, \qquad\mbox{for } x = 0, 1, 2, …\tag{fmass-pascal} \]

This \(p(x)\) can be interpreted as the probability of having \(x\) failures before the \(n\)th success in a sequence of independent Bernoulli trials with probability of success \(p\). For \(n=1\), this gives the geometric distribution.

Definition at line 48 of file PascalDist.java.

Constructor & Destructor Documentation

◆ PascalDist()

umontreal.ssj.probdist.PascalDist.PascalDist ( int n,
double p )

Creates an object that contains the probability terms ( fmass-pascal ) and the distribution function for the Pascal distribution with parameter \(n\) and \(p\).

Definition at line 91 of file PascalDist.java.

Member Function Documentation

◆ getInstanceFromMLE()

PascalDist umontreal.ssj.probdist.PascalDist.getInstanceFromMLE ( int[] x,
int m )
static

Creates a new instance of a Pascal distribution with parameters.

\(n\) and \(p\) estimated using the maximum likelihood method based on the \(m\) observations \(x[i]\), \(i = 0, 1, …, m-1\).

Parameters
xthe list of observations to use to evaluate parameters
mthe number of observations to use to evaluate parameters

Reimplemented from umontreal.ssj.probdist.NegativeBinomialDist.

Definition at line 165 of file PascalDist.java.

◆ getMLE()

double[] umontreal.ssj.probdist.PascalDist.getMLE ( int[] x,
int m )
static

Estimates the parameter \((n, p)\) of the Pascal distribution using the maximum likelihood method, from the \(m\) observations.

\(x[i]\), \(i = 0, 1, …, m-1\). The estimates are returned in a two-element array, in regular order: [ \(n\), \(p\)]. The maximum likelihood estimators are the values \((\hat{n}\), \(\hat{p})\) that satisfy the equations

\begin{align*} \frac{\hat{n}(1 - \hat{p})}{\hat{p}} & = \bar{x}_m \\ \ln(1 + \hat{p}) & = \sum_{j=1}^{\infty} \frac{F_j}{(\hat{n} + j - 1)} \end{align*}

where \(\bar{x}_m\) is the average of \(x[0],…,x[m-1]\), and \(F_j = \sum_{i=j}^{\infty} f_i\) = proportion of \(x\)’s which are greater than or equal to \(j\) [93]  (page 132).

Parameters
xthe list of observations used to evaluate parameters
mthe number of observations used to evaluate parameters
Returns
returns the parameters [ \(\hat{n}\), \(\hat{p}\)]

Reimplemented from umontreal.ssj.probdist.NegativeBinomialDist.

Definition at line 112 of file PascalDist.java.

◆ getN1()

int umontreal.ssj.probdist.PascalDist.getN1 ( )

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

Definition at line 173 of file PascalDist.java.

◆ setParams()

void umontreal.ssj.probdist.PascalDist.setParams ( int n,
double p )

Sets the parameter \(n\) and \(p\) of this object.

Definition at line 180 of file PascalDist.java.

◆ toString()

String umontreal.ssj.probdist.PascalDist.toString ( )

Returns a String containing information about the current distribution.

Reimplemented from umontreal.ssj.probdist.NegativeBinomialDist.

Definition at line 187 of file PascalDist.java.


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