SSJ
V. 1.1.9.

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 classes supporting discrete and continuous distributions over the real numbers.
 

Class Summary
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.
BiNormalDist Extends the class ContinuousDistribution2Dim for the bivariate normal distribution.
BiNormalDonnellyDist Extends the class BiNormalDist for the bivariate normal distribution using a translation of Donnelly's FORTRAN code.
BiNormalGenzDist Extends the class BiNormalDist for the bivariate normal distribution using Genz's algorithm as described in.
BivariateTDist Extends the class ContinuousDistribution2Dim for the standard bivariate t distribution.
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.
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.
ContinuousDistribution Classes implementing continuous distributions should inherit from this class.
ContinuousDistribution2Dim Classes implementing 2-dimensionnal continuous distributions should inherit from this class.
ContinuousEmpiricalDist Extends the ContinuousDistribution for the empirical distribution with known individual observations.
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 ContinuousDistribution for 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.
ExtremeValueDist Extends the class ContinuousDistribution for the extreme value (or Gumbel) distribution, with location parameter α and scale parameter λ > 0.
GammaDist Extends the class ContinuousDistribution for the gamma distribution with shape parameter α > 0 and scale parameter λ > 0.
GeometricDist Extends the class DiscreteDistributionInt for the geometric distribution with parameter p, where 0 < p < 1.
HypergeometricDist Extends the class DiscreteDistributionInt for the hypergeometric distribution with k elements choosen among l, m being of one type, and l - m of the other.
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.
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.
LognormalDist Extends the class ContinuousDistribution for the lognormal distribution.
NegativeBinomialDist Extends the class DiscreteDistributionInt for the negative binomial distribution with parameters n and p, where n is a positive integer 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).
ParetoDist Extends the class ContinuousDistribution for a distribution from the Pareto family, with shape parameter α > 0 and location 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.
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].
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 does not generate random numbers; for that, see the package randvar.

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∈$\displaystyle \mathbb {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 of the abstract class Distribution (and sometimes ContinuousDistribution) are required by some methods in the classes GofStat and GofFormat, in package gof.


SSJ
V. 1.1.9.

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