SSJ  3.2.1
Stochastic Simulation in Java
 All Classes Namespaces Functions Variables Pages
Classes
Package umontreal.ssj.probdist

Probability Distributions. More...

Classes

class  AndersonDarlingDist
 Extends the class ContinuousDistribution for the Anderson–Darling distribution (see [5], [139], [146], [192] ). More...
 
class  AndersonDarlingDistQuick
 Extends the class AndersonDarlingDist for the Anderson–Darling distribution (see [5], [139], [192] ). More...
 
class  BernoulliDist
 Extends the class DiscreteDistributionInt for the Bernoulli distribution [107]  with parameter \(p\), where \(0\le p\le1\). More...
 
class  BetaDist
 Extends the class ContinuousDistribution for the beta distribution [89]  (page 210) with shape parameters \(\alpha> 0\) and \(\beta> 0\), over the interval \([a,b]\), where \(a < b\). More...
 
class  BetaSymmetricalDist
 Specializes the class BetaDist to the case of a symmetrical beta distribution over the interval \([0,1]\), with shape parameters \(\alpha= \beta\). More...
 
class  BinomialDist
 Extends the class DiscreteDistributionInt for the binomial distribution [107]  (page 321) with parameters \(n\) and \(p\), where \(n\) is a positive integer and \(0\le p\le1\). More...
 
class  CauchyDist
 Extends the class ContinuousDistribution for the Cauchy distribution [88]  (page 299) with location parameter \(\alpha\) and scale parameter \(\beta> 0\). More...
 
class  ChiDist
 Extends the class ContinuousDistribution for the chi distribution [88]  (page 417) with shape parameter \(\nu > 0\), where the number of degrees of freedom \(\nu\) is a positive integer. More...
 
class  ChiSquareDist
 Extends the class ContinuousDistribution for the chi-square distribution with \(n\) degrees of freedom, where \(n\) is a positive integer [88]  (page 416). More...
 
class  ChiSquareDistQuick
 Provides a variant of ChiSquareDist with faster but less accurate methods. More...
 
class  ChiSquareNoncentralDist
 Extends the class ContinuousDistribution for the noncentral chi-square distribution with \(\nu\) degrees of freedom and noncentrality parameter \(\lambda\), where \(\nu> 0\) and \(\lambda> 0\) [89]  (page 436). More...
 
class  ConstantDist
 Represents a constant discrete distribution taking a single real value with probability 1. More...
 
class  ConstantIntDist
 Represents a constant discrete distribution taking a single integer value with probability 1. More...
 
class  ContinuousDistribution
 Classes implementing continuous distributions should inherit from this base class. More...
 
class  CramerVonMisesDist
 Extends the class ContinuousDistribution for the Cramér-von Mises distribution (see [48], [191], [192] ). More...
 
class  DiscreteDistribution
 This class implements discrete distributions over a finite set of real numbers (also over integers as a particular case). More...
 
class  DiscreteDistributionInt
 Classes implementing discrete distributions over the integers should inherit from this class. More...
 
interface  Distribution
 This interface should be implemented by all classes supporting discrete and continuous distributions. More...
 
class  DistributionFactory
 This class implements a string API for the package probdist. More...
 
class  EmpiricalDist
 Extends DiscreteDistribution to an empirical distribution function, based on the observations \(X_{(1)},…,X_{(n)}\) (sorted by increasing order). More...
 
class  ErlangDist
 Extends the class GammaDist for the special case of the Erlang distribution with shape parameter \(k > 0\) and scale parameter \(\lambda> 0\). More...
 
class  ExponentialDist
 Extends the class ContinuousDistribution for the exponential distribution [88]  (page 494) with mean \(1/\lambda\) where \(\lambda> 0\). More...
 
class  ExponentialDistFromMean
 Extends the ExponentialDist class with a constructor accepting as argument the mean \(1/\lambda\) instead of the rate \(\lambda\). More...
 
class  ExtremeValueDist
 This class has been replaced by GumbelDist . More...
 
class  FatigueLifeDist
 Extends the class ContinuousDistribution for the fatigue life distribution [18]  with location parameter \(\mu\), scale parameter \(\beta\) and shape parameter \(\gamma\). More...
 
class  FisherFDist
 Extends the class ContinuousDistribution for the Fisher F distribution with \(n_1\) and \(n_2\) degrees of freedom, where \(n_1\) and \(n_2\) are positive integers. More...
 
class  FoldedNormalDist
 Extends the class ContinuousDistribution for the folded normal distribution with parameters \(\mu\ge0\) and \(\sigma> 0\). More...
 
class  FrechetDist
 Extends the class ContinuousDistribution for the Fréchet distribution [89]  (page 3), with location parameter \(\delta\), scale parameter \(\beta> 0\), and shape parameter \(\alpha> 0\), where we use the notation \(z = (x-\delta)/\beta\). More...
 
class  GammaDist
 Extends the class ContinuousDistribution for the gamma distribution [88]  (page 337) with shape parameter \(\alpha> 0\) and scale parameter \(\lambda> 0\). More...
 
class  GammaDistFromMoments
 Extends the GammaDist distribution with constructors accepting the mean \(\mu\) and variance \(\sigma^2\) as arguments instead of a shape parameter \(\alpha\) and a scale parameter \(\lambda\). More...
 
class  GeometricDist
 Extends the class DiscreteDistributionInt for the geometric distribution [107]  (page 322) with parameter \(p\), where \(0 < p < 1\). More...
 
class  GumbelDist
 Extends the class ContinuousDistribution for the Gumbel distribution [89]  (page 2), with location parameter \(\delta\) and scale parameter \(\beta\neq0\). More...
 
class  HalfNormalDist
 Extends the class ContinuousDistribution for the half-normal distribution with parameters \(\mu\) and \(\sigma> 0\). More...
 
class  HyperbolicSecantDist
 Extends the class ContinuousDistribution for the hyperbolic secant distribution with location parameter \(\mu\) and scale parameter \(\sigma> 0\). More...
 
class  HypergeometricDist
 Extends the class DiscreteDistributionInt for the hypergeometric distribution [60]  (page 101) with \(k\) elements chosen among \(l\), \(m\) being of one type, and \(l-m\) of the other. More...
 
class  HypoExponentialDist
 This class implements the hypoexponential distribution, also called the generalized Erlang distribution. More...
 
class  HypoExponentialDistEqual
 This class implements the hypoexponential distribution for the case of equidistant \(\lambda_i = (n+1-i)h\). More...
 
class  HypoExponentialDistQuick
 This class is a subclass of HypoExponentialDist and also implements the hypoexponential distribution. More...
 
class  InverseDistFromDensity
 Implements a method for computing the inverse of an arbitrary continuous distribution function when only the probability density is known [39] . More...
 
class  InverseGammaDist
 Extends the class ContinuousDistribution for the inverse gamma distribution with shape parameter \(\alpha> 0\) and scale parameter \(\beta> 0\). More...
 
class  InverseGaussianDist
 Extends the class ContinuousDistribution for the inverse Gaussian distribution with location parameter \(\mu> 0\) and scale parameter \(\lambda> 0\). More...
 
class  JohnsonSBDist
 Extends the class ContinuousDistribution for the Johnson \(S_B\) distribution [90], [107], [56]  with shape parameters \(\gamma\) and \(\delta> 0\), location parameter \(\xi\), and scale parameter \(\lambda>0\). More...
 
class  JohnsonSLDist
 Extends the class ContinuousDistribution for the Johnson \(S_L\) distribution (see [90], [88] ). More...
 
class  JohnsonSUDist
 Extends the class ContinuousDistribution for the Johnson \(S_U\) distribution (see [107]  (page 316)). More...
 
class  JohnsonSystem
 This class contains common parameters and methods for the Johnson system of distributions [90], [88]  with shape parameters \(\gamma\) and \(\delta> 0\), location parameter \(\xi\), and scale parameter \(\lambda>0\). More...
 
class  KolmogorovSmirnovDist
 Extends the class ContinuousDistribution for the Kolmogorov-Smirnov distribution with parameter \(n\) [48] . More...
 
class  KolmogorovSmirnovDistQuick
 Extends the class KolmogorovSmirnovDist for the Kolmogorov–Smirnov distribution. More...
 
class  KolmogorovSmirnovPlusDist
 Extends the class ContinuousDistribution for the Kolmogorov–Smirnov+ distribution (see [36], [48], [25] ). More...
 
class  LaplaceDist
 Extends the class ContinuousDistribution for the Laplace distribution (see, e.g., [89]  (page 165)). More...
 
class  LogarithmicDist
 Extends the class DiscreteDistributionInt for the logarithmic distribution. More...
 
class  LogisticDist
 Extends the class ContinuousDistribution for the logistic distribution (e.g., [89]  (page 115)). More...
 
class  LoglogisticDist
 Extends the class ContinuousDistribution for the Log-Logistic distribution with shape parameter \(\alpha> 0\) and scale parameter \(\beta> 0\). More...
 
class  LognormalDist
 Extends the class ContinuousDistribution for the lognormal distribution [88] . More...
 
class  LognormalDistFromMoments
 Extends the LognormalDist class with a constructor accepting the mean \(m\) and the variance \(v\) of the distribution as arguments. More...
 
class  NakagamiDist
 Extends the class ContinuousDistribution for the Nakagami distribution with location parameter \(a\), scale parameter \(\lambda> 0\) and shape parameter \(c > 0\). More...
 
class  NegativeBinomialDist
 Extends the class DiscreteDistributionInt for the negative binomial distribution [107]  (page 324) with real parameters \(n\) and \(p\), where \(n > 0\) and \(0\le p\le1\). More...
 
class  NormalDist
 Extends the class ContinuousDistribution for the normal distribution (e.g., [88]  (page 80)). More...
 
class  NormalDistQuick
 A variant of the class NormalDist (for the normal distribution with mean \(\mu\) and variance \(\sigma^2\)). More...
 
class  NormalInverseGaussianDist
 Extends the class ContinuousDistribution for the normal inverse gaussian distribution with location parameter \(\mu\), scale parameter \(\delta> 0\), tail heavyness \(\alpha> 0\), and asymmetry parameter \(\beta\) such that \(0 \le|\beta| < \alpha\). More...
 
class  ParetoDist
 Extends the class ContinuousDistribution for a distribution from the Pareto family, with shape parameter \(\alpha> 0\) and location parameter \(\beta> 0\) [88]  (page 574). More...
 
class  PascalDist
 The Pascal distribution is a special case of the negative binomial distribution [107]  (page 324) with parameters \(n\) and \(p\), where \(n\) is a positive integer and \(0\le p\le1\). More...
 
class  Pearson5Dist
 THIS CLASS HAS BEEN RENAMED InverseGammaDist . More...
 
class  Pearson6Dist
 Extends the class ContinuousDistribution for the Pearson type VI distribution with shape parameters \(\alpha_1 > 0\) and \(\alpha_2 > 0\), and scale parameter \(\beta> 0\). More...
 
class  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., [107]  (page 318)). More...
 
class  PoissonDist
 Extends the class DiscreteDistributionInt for the Poisson distribution [107]  (page 325) with mean \(\lambda\ge0\). More...
 
class  PowerDist
 Extends the class ContinuousDistribution for the power distribution [50]  (page 161) with shape parameter \(c > 0\), over the interval \([a,b]\), where \(a < b\). More...
 
class  RayleighDist
 This class extends the class ContinuousDistribution for the Rayleigh distribution [50]  with location parameter \(a\), and scale parameter \(\beta> 0\). More...
 
class  StudentDist
 Extends the class ContinuousDistribution for the Student \(t\)-distribution [89]  (page 362) with \(n\) degrees of freedom, where \(n\) is a positive integer. More...
 
class  StudentDistQuick
 Extends the class StudentDist for the Student \(t\)-distribution. More...
 
class  TriangularDist
 Extends the class ContinuousDistribution for the triangular distribution (see [89]  (page 297) and [107]  (page 317)) with domain \([a,b]\) and mode (or shape parameter) \(m\), where \(a\le m\le b\). More...
 
class  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. More...
 
class  UniformDist
 Extends the class ContinuousDistribution for the uniform distribution [89]  (page 276) over the interval \([a,b]\). More...
 
class  UniformIntDist
 Extends the class DiscreteDistributionInt for the discrete uniform distribution over the range \([i,j]\). More...
 
class  WatsonGDist
 Extends the class ContinuousDistribution for the Watson \(G\) distribution (see [37], [203] ). More...
 
class  WatsonUDist
 Extends the class ContinuousDistribution for the Watson U distribution (see [48], [191], [192] ). More...
 
class  WeibullDist
 This class extends the class ContinuousDistribution for the Weibull distribution [88]  (page 628) with shape parameter \(\alpha> 0\), location parameter \(\delta\), and scale parameter \(\lambda> 0\). More...
 

Detailed Description

Probability Distributions.

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 umontreal.ssj.randvar. It is possible to plot the density or the cumulative probabilities of a distribution function either on screen, or in a LaTeX file, but for this, one has to use the package umontreal::ssj::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\le x] = \int_{-\infty}^x f(s)ds \tag{FDist} \]

while that of a discrete random variable \(X\) with mass function \(p\) over a fixed set of real numbers \(x_0 < x_1 < x_2 < \cdots\) is

\[ F(x) = P[X\le x] = \sum_{x_i\le x} p(x_i), \tag{FDistDisc} \]

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

\[ F (x) = P[X\le x] = \sum_{s=-\infty}^x p(s), \tag{FDistDiscInt} \]

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

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

\[ \bar{F} (x) = P[X\ge 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\ge 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\in\mathbb{R}: F (x)\ge u\}, \tag{inverseF} \]

for \(0\le u\le1\). 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 umontreal.ssj.probdist.DiscreteDistribution and umontreal.ssj.probdist.ContinuousDistribution (which both implement the interface umontreal.ssj.probdist.Distribution ) for discrete and continuous distributions over the real numbers, or umontreal.ssj.probdist.DiscreteDistributionInt, for discrete distributions over the non-negative integers.

For example, the class umontreal.ssj.probdist.PoissonDist extends umontreal.ssj.probdist.DiscreteDistributionInt. Calling a static method from this class will compute the corresponding probability from scratch. Constructing a umontreal.ssj.probdist.PoissonDist object, on the other hand, will precompute tables that contain the probability terms and the distribution function for a given parameter \(\lambda\) (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 \(\lambda\). 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 umontreal.ssj.probdist.DiscreteDistributionInt.EPSILON ) are stored in the tables. For \(F\) and \(\bar{F}\), a single table actually contains \(F (x)\) for \(F (x) \le1/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 umontreal.ssj.probdist.Distribution (and sometimes the abstract class umontreal.ssj.probdist.ContinuousDistribution ) are required by some methods in package umontreal.ssj.randvar and also in classes umontreal.ssj.gof.GofStat and umontreal.ssj.gof.GofFormat of package umontreal::ssj::gof.

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