Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package umontreal.iro.lecuyer.probdist

This package contains a set of Java classes providing methods to compute mass, density, distribution, complementary distribution, and inverse distribution functions for some discrete and continuous probability distributions.

See:
Description

Interface Summary
Distribution | This interface should be implemented by all classes supporting discrete and continuous distributions.

Class Summary
AndersonDarlingDist | Extends the class `ContinuousDistribution` for the Anderson-Darling distribution (see).
AndersonDarlingDistQuick | Extends the class `AndersonDarlingDist` for the distribution (see).
BetaDist | Extends the class `ContinuousDistribution` for the beta distribution with shape parameters α > 0 and β > 0, over the interval (a, b), where a < b.
BetaSymmetricalDist | Specializes the class `BetaDist` to the case of a symmetrical beta distribution over the interval [0, 1], with shape parameters α = β.
BinomialDist | Extends the class `DiscreteDistributionInt` for the binomial distribution with parameters n and p, where n is a positive integer and 0 <= p <= 1.
CauchyDist | Extends the class `ContinuousDistribution` for the Cauchy distribution with location parameter α and scale parameter β > 0.
ChiDist | Extends the class `ContinuousDistribution` for the chi distribution with shape parameter v > 0, where the number of degrees of freedom v is a positive integer.
ChiSquareDist | Extends the class `ContinuousDistribution` for the chi-square distribution with n degrees of freedom, where n is a positive integer.
ChiSquareDistQuick | Provides a variant of `ChiSquareDist` with faster but less accurate methods.
ChiSquareNoncentralDist | Extends the class `ContinuousDistribution` for the noncentral chi-square distribution with ν degrees of freedom and noncentrality parameter λ, where ν > 0 and λ > 0.
ContinuousDistribution | Classes implementing continuous distributions should inherit from this class.
CramerVonMisesDist | Extends the class `ContinuousDistribution` for the Cramér-von Mises distribution (see).
DiscreteDistribution | Classes implementing discrete distributions over a finite set of real numbers should inherit from this class.
DiscreteDistributionInt | Classes implementing discrete distributions over the integers should inherit from this class.
DistributionFactory | This class implements a string API for the package `probdist`.
EmpiricalDist | Extends `DiscreteDistribution` to an empirical distribution function, based on the observations X(1),..., X(n) (sorted by increasing order).
ErlangDist | Extends the class `GammaDist` for the special case of the Erlang distribution with shape parameter k > 0 and scale parameter λ > 0.
ExponentialDist | Extends the class `ContinuousDistribution` for the exponential distribution with mean 1/λ where λ > 0.
ExponentialDistFromMean | Extends the `ExponentialDist` class with a constructor accepting as argument the mean 1/λ instead of the rate λ.
ExtremeValueDist | Extends the class `ContinuousDistribution` for the extreme value (or Gumbel) distribution, with location parameter α and scale parameter λ > 0.
FatigueLifeDist | Extends the class `ContinuousDistribution` for the fatigue life distribution with location parameter μ, scale parameter β and shape parameter γ.
FisherFDist | Extends the class `ContinuousDistribution` for the Fisher F distribution with n and m degrees of freedom, where n and m are positive integers.
FoldedNormalDist | Extends the class `ContinuousDistribution` for the folded normal distribution with parameters μ >= 0 and σ > 0.
GammaDist | Extends the class `ContinuousDistribution` for the gamma distribution with shape parameter α > 0 and scale parameter λ > 0.
GammaDistFromMoments | Extends the `GammaDist` distribution with constructors accepting the mean μ and variance σ2 as arguments instead of a shape parameter α and a scale parameter λ.
GeometricDist | Extends the class `DiscreteDistributionInt` for the geometric distribution with parameter p, where 0 < p < 1.
HalfNormalDist | Extends the class `ContinuousDistribution` for the half-normal distribution with parameters μ and σ > 0.
HyperbolicSecantDist | Extends the class `ContinuousDistribution` for the Hyperbolic Secant distribution with location parameter μ and scale parameter σ > 0.
HypergeometricDist | Extends the class `DiscreteDistributionInt` for the hypergeometric distribution with k elements chosen among l, m being of one type, and l - m of the other.
InverseGaussianDist | Extends the class `ContinuousDistribution` for the inverse Gaussian distribution with location parameter μ > 0 and scale parameter λ > 0.
JohnsonSBDist | Extends the class `ContinuousDistribution` for the Johnson SB distribution with shape parameters γ and δ > 0, location parameter ξ, and scale parameter λ > 0.
JohnsonSUDist | Extends the class `ContinuousDistribution` for the Johnson SU distribution.
KolmogorovSmirnovDist | Extends the class `ContinuousDistribution` for the Kolmogorov-Smirnov distribution with parameter n.
KolmogorovSmirnovDistQuick | Extends the class `KolmogorovSmirnovDist` for the distribution.
KolmogorovSmirnovPlusDist | Extends the class `ContinuousDistribution` for the Kolmogorov-Smirnov+ distribution (see).
LaplaceDist | Extends the class `ContinuousDistribution` for the Laplace distribution.
LogarithmicDist | Extends the class `DiscreteDistributionInt` for the logarithmic distribution.
LogisticDist | Extends the class `ContinuousDistribution` for the logistic distribution.
LoglogisticDist | Extends the class `ContinuousDistribution` for the Log-Logistic distribution with shape parameter α > 0 and scale parameter β > 0.
LognormalDist | Extends the class `ContinuousDistribution` for the lognormal distribution.
LognormalDistFromMoments | Extends the `LognormalDist` class with a constructor accepting the mean m and the variance v of the distribution as arguments.
NakagamiDist | Extends the class `ContinuousDistribution` for the Nakagami distribution with location parameter a, scale parameter λ > 0 and shape parameter c > 0.
NegativeBinomialDist | Extends the class `DiscreteDistributionInt` for the negative binomial distribution with real parameters γ and p, where γ > 0 and 0 <= p <= 1.
NormalDist | Extends the class `ContinuousDistribution` for the normal distribution (e.g.,).
NormalDistQuick | A variant of the class `NormalDist` (for the normal distribution with mean μ and variance σ2).
NormalInverseGaussianDist | Extends the class `ContinuousDistribution` for the normal inverse gaussian distribution with location parameter μ, scale parameter δ > 0, tail heavyness α > 0, and asymmetry parameter β such that 0 <= | β| < α.
ParetoDist | Extends the class `ContinuousDistribution` for a distribution from the Pareto family, with shape parameter α > 0 and location parameter β > 0.
PascalDist | 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.
Pearson5Dist | Extends the class `ContinuousDistribution` for the Pearson type V distribution with shape parameter α > 0 and scale parameter β > 0.
Pearson6Dist | Extends the class `ContinuousDistribution` for the Pearson type VI distribution with shape parameters α1 > 0 and α2 > 0, and scale parameter β > 0.
PiecewiseLinearEmpiricalDist | Extends the class `ContinuousDistribution` for a piecewise-linear approximation of the empirical distribution function, based on the observations X(1),..., X(n) (sorted by increasing order), and defined as follows (e.g.,).
PoissonDist | Extends the class `DiscreteDistributionInt` for the Poisson distribution with mean λ >= 0.
PowerDist | Extends the class `ContinuousDistribution` for the power distribution with shape parameter c > 0, over the interval [a, b], where a < b.
RayleighDist | This class extends the class `ContinuousDistribution` for the Rayleigh distribution with location parameter a, and scale parameter β > 0.
StudentDist | Extends the class `ContinuousDistribution` for the Student-t distribution with n degrees of freedom, where n is a positive integer.
TriangularDist | Extends the class `ContinuousDistribution` for the triangular distribution with domain [a, b] and mode (or shape parameter) m, where a <= m <= b.
TruncatedDist | This container class takes an arbitrary continuous distribution and truncates it to an interval [a, b], where a and b can be finite or infinite.
UniformDist | Extends the class `ContinuousDistribution` for the uniform distribution over the interval [a, b].
UniformIntDist | Extends the class `DiscreteDistributionInt` for the discrete uniform distribution over the range [i, j].
WatsonGDist | Extends the class `ContinuousDistribution` for the Watson G distribution (see).
WatsonUDist | Extends the class `ContinuousDistribution` for the Watson U distribution (see).
WeibullDist | This class extends the class `ContinuousDistribution` for the Weibull distribution with shape parameter α > 0, location parameter δ, and scale parameter λ > 0.

## Package umontreal.iro.lecuyer.probdist Description

This package contains a set of Java classes providing methods to compute mass, density, distribution, complementary distribution, and inverse distribution functions for some discrete and continuous probability distributions. It also provides methods to estimate the parameters of some distributions from empirical data. It does not generate random variates; for that, see the package `randvar`. It is possible to plot the density or the cumulative probabilities of a distribution function either on screen, or in a LATEXfile, but for this, one has to use the package `charts`.

## Distributions

We recall that the distribution function of a continuous random variable X with density f over the real line is

F(x) = P[X <= x] = ∫-∞xf (s)ds

while that of a discrete random variable X with mass function p over a fixed set of real numbers x0 < x1 < x2 < ... is

F(x) = P[X <= x] = ∑xi <= xp(xi),

where p(xi) = P[X = xi]. For a discrete distribution over the set of integers, one has

F(x) = P[X <= x] = ∑s=-∞xp(s),

where p(s) = P[X = s].

We define bar(F), the complementary distribution function of X, by

bar(F)(x) = P[X >= x].

With this definition of bar(F), one has bar(F)(x) = 1 - F(x) for continuous distributions and bar(F)(x) = 1 - F(x - 1) for discrete distributions over the integers. This definition is non-standard for the discrete case: we have bar(F)(x) = P[X >= x] instead of bar(F)(x) = P[X > x] = 1 - F(x). We find it more convenient especially for computing p-values in goodness-of-fit tests.

The inverse distribution function is defined as

F-1(u) = inf{x∈R : F(x) >= u},

for 0 <= u <= 1. This function F-1 is often used, among other things, to generate the random variable X by inversion, by passing a U(0, 1) random variate as the value of u.

The package `probdist` offers two types of tools for computing p, f, F, bar(F), and F-1: static methods, for which no object needs to be created, and methods associated with distribution objects. Standard distributions are implemented each in their own class. Constructing an object from one of these classes can be convenient if F, bar(F), etc., has to be evaluated several times for the same distribution. In certain cases (for the Poisson distribution, for example), creating the distribution object would precompute tables that would speed up significantly all subsequent method calls for computing F, bar(F), etc. This trades memory, plus a one-time setup cost, for speed. In addition to the non-static methods, the distribution classes also provide static methods that do not require the creation of an object.

The distribution classes extend one of the (abstract) classes `DiscreteDistribution` and `ContinuousDistribution` (which both implement the interface `Distribution`) for discrete and continuous distributions over the real numbers, or `DiscreteDistributionInt`, for discrete distributions over the non-negative integers.

For example, the class `PoissonDist` extends `DiscreteDistributionInt`. Calling a static method from this class will compute the corresponding probability from scratch. Constructing a `PoissonDist` object, on the other hand, will precompute tables that contain the probability terms and the distribution function for a given parameter λ (the mean of the Poisson distribution). These tables will then be used whenever a method is called for the corresponding object. This second approach is recommended if some of F, bar(F), etc., has to be computed several times for the same parameter λ. As a rule of thumb, creating objects and using their methods is faster than just using static methods as soon as two or three calls are made, unless the parameters are large.

In fact, only the non-negligible probability terms (those that exceed the threshold `DiscreteDistributionInt.EPSILON`) are stored in the tables. For F and bar(F), a single table actually contains F(x) for F(x) <= 1/2 and 1 - F(x) for F(x) > 1/2. When the distribution parameters are so large that the tables would take too much space, these are not created and the methods automatically call their static equivalents instead of using tables.

Objects that implement the interface `Distribution` (and sometimes `ContinuousDistribution`) are required by some methods in package `randvar` and also in the classes `GofStat` and `GofFormat`, in package `gof`.

Some of the classes also provide methods that compute parameter estimators of the corresponding distribution from a set of empirical observations, in most cases based on the maximum likelihood method.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

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