Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.probdist
Class PascalDist

    java.lang.Object
      umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
          umontreal.iro.lecuyer.probdist.NegativeBinomialDist
              umontreal.iro.lecuyer.probdist.PascalDist

All Implemented Interfaces:
  Distribution

    public class PascalDist

extends NegativeBinomialDist

The Pascal distribution is a special case of the negative binomial distribution with parameters n and p, where n is a positive integer and 0 <= p <= 1. Its mass function is

p(x) = nCr(n + x - 1, x)pn(1 - p)x, for x = 0, 1, 2,…

where nCr is defined in `BinomialDist`. This p(x) can be interpreted as the probability of having x failures before the nth success in a sequence of independent Bernoulli trials with probability of success p. For n = 1, this gives the geometric distribution.

Field Summary

Fields inherited from class umontreal.iro.lecuyer.probdist.NegativeBinomialDist
`MAXN`

Fields inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
`EPSILON`

Constructor Summary
`PascalDist(int n, double p)` Creates an object that contains the probability terms and the distribution function for the Pascal distribution with parameter n and p.

Method Summary
`static PascalDist` | `getInstanceFromMLE(int[] x, int m)` 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.
`static double[]` | `getMaximumLikelihoodEstimate(int[] x, int m)` Deprecated.
`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 x[i], i = 0, 1,…, m - 1.
`int` | `getN()` Returns the parameter n of this object.
`double[]` | `getParams()` Return a table containing the parameters of the current distribution.
`void` | `setParams(int n, double p)` Sets the parameter n and p of this object.
`String` | `toString()`

Methods inherited from class umontreal.iro.lecuyer.probdist.NegativeBinomialDist
`barF, cdf, cdf, getGamma, getInstanceFromMLE, getMaximumLikelihoodEstimate, getMean, getMean, getMLE, getP, getStandardDeviation, getStandardDeviation, getVariance, getVariance, inverseF, inverseFInt, prob, prob, setParams`

Methods inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
`barF, cdf, inverseF`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PascalDist

    public PascalDist(int n,
                      double p)

  Creates an object that contains the probability terms and the distribution function for the Pascal distribution with parameter n and p.

Method Detail

### getMLE

    public 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 x[i], i = 0, 1,…, m - 1. The estimates are returned in a two-element array, in regular order: [n, p].

  Parameters:
    `x` - the list of observations used to evaluate parameters
    `m` - the number of observations used to evaluate parameters
  Returns:
    returns the parameters [hat(n), hat(p)]

### getMaximumLikelihoodEstimate

    @Deprecated
    public static double[] getMaximumLikelihoodEstimate(int[] x,
                                                                   int m)

  Deprecated.

  Same as `getMLE`.

### getInstanceFromMLE

    public static PascalDist getInstanceFromMLE(int[] x,
                                                int m)

  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:
    `x` - the list of observations to use to evaluate parameters
    `m` - the number of observations to use to evaluate parameters

### getN

    public int getN()

  Returns the parameter n of this object.

### setParams

    public void setParams(int n,
                          double p)

  Sets the parameter n and p of this object.

### getParams

    public double[] getParams()

  Return a table containing the parameters of the current distribution. This table is put in regular order: [n, p].

  Specified by:
    `getParams` in interface `Distribution`
  Overrides:
    `getParams` in class `NegativeBinomialDist`

### toString

    public String toString()

  Overrides:
    `toString` in class `NegativeBinomialDist`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.