SSJ
V. 2.6.

umontreal.iro.lecuyer.probdist
Class ContinuousDistribution

java.lang.Object
  extended by umontreal.iro.lecuyer.probdist.ContinuousDistribution
All Implemented Interfaces:
Distribution
Direct Known Subclasses:
AndersonDarlingDist, BetaDist, CauchyDist, ChiDist, ChiSquareDist, ChiSquareNoncentralDist, CramerVonMisesDist, ExponentialDist, ExtremeValueDist, FatigueLifeDist, FisherFDist, FoldedNormalDist, FrechetDist, GammaDist, GumbelDist, HalfNormalDist, HyperbolicSecantDist, HypoExponentialDist, InverseDistFromDensity, InverseGammaDist, InverseGaussianDist, JohnsonSBDist, JohnsonSLDist, JohnsonSUDist, KolmogorovSmirnovDist, KolmogorovSmirnovPlusDist, LaplaceDist, LogisticDist, LoglogisticDist, LognormalDist, NakagamiDist, NormalDist, NormalInverseGaussianDist, ParetoDist, Pearson5Dist, Pearson6Dist, PiecewiseLinearEmpiricalDist, PowerDist, RayleighDist, StudentDist, TriangularDist, TruncatedDist, UniformDist, WatsonGDist, WatsonUDist, WeibullDist

public abstract class ContinuousDistribution
extends Object
implements Distribution

Classes implementing continuous distributions should inherit from this base class. Such distributions are characterized by a density function f (x), thus the signature of a density method is supplied here. This class also provides default implementations for bar(F)(x) and for F-1(u), the latter using the Brent-Dekker method to find the inverse of a generic distribution function F.


Field Summary
 int decPrec
          Deprecated. 
 
Constructor Summary
ContinuousDistribution()
           
 
Method Summary
 double barF(double x)
          Returns the complementary distribution function.
abstract  double density(double x)
          Returns f (x), the density evaluated at x.
 double getMean()
          Returns the mean.
 double getStandardDeviation()
          Returns the standard deviation.
 double getVariance()
          Returns the variance.
 double getXinf()
          Returns xa such that the probability density is 0 everywhere outside the interval [xa, xb].
 double getXsup()
          Returns xb such that the probability density is 0 everywhere outside the interval [xa, xb].
 double inverseBisection(double u)
          Computes and returns the inverse distribution function x = F-1(u), using bisection.
 double inverseBrent(double a, double b, double u, double tol)
          Computes the inverse distribution function x = F-1(u), using the Brent-Dekker method.
 double inverseF(double u)
          Returns the inverse distribution function x = F-1(u).
 void setXinf(double xa)
          Sets the value xa = xa, such that the probability density is 0 everywhere outside the interval [xa, xb].
 void setXsup(double xb)
          Sets the value xb = xb, such that the probability density is 0 everywhere outside the interval [xa, xb].
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface umontreal.iro.lecuyer.probdist.Distribution
cdf, getParams
 

Field Detail

decPrec

@Deprecated
public int decPrec
Deprecated. 
Constructor Detail

ContinuousDistribution

public ContinuousDistribution()
Method Detail

density

public abstract double density(double x)
Returns f (x), the density evaluated at x.

Parameters:
x - value at which the density is evaluated
Returns:
density function evaluated at x

barF

public double barF(double x)
Returns the complementary distribution function. The default implementation computes bar(F)(x) = 1 - F(x).

Specified by:
barF in interface Distribution
Parameters:
x - value at which the complementary distribution function is evaluated
Returns:
complementary distribution function evaluated at x

inverseBrent

public double inverseBrent(double a,
                           double b,
                           double u,
                           double tol)
Computes the inverse distribution function x = F-1(u), using the Brent-Dekker method. The interval [a, b] must contain the root x such that F(a) <= u <= F(b), where u = F(x). The calculations are done with an approximate precision of tol. Returns x = F-1(u). Restrictions: u∈[0, 1].

Parameters:
a - left endpoint of initial interval
b - right endpoint of initial interval
u - value at which the inverse distribution function is evaluated
tol - accuracy goal
Returns:
inverse distribution function evaluated at u

inverseBisection

public double inverseBisection(double u)
Computes and returns the inverse distribution function x = F-1(u), using bisection. Restrictions: u∈[0, 1].

Parameters:
u - value at which the inverse distribution function is evaluated
Returns:
the inverse distribution function evaluated at u
Throws:
IllegalArgumentException - if u is not in the interval [0, 1]

inverseF

public double inverseF(double u)
Returns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].

Specified by:
inverseF in interface Distribution
Parameters:
u - value at which the inverse distribution function is evaluated
Returns:
the inverse distribution function evaluated at u
Throws:
IllegalArgumentException - if u is not in the interval [0, 1]

getMean

public double getMean()
Returns the mean.

Specified by:
getMean in interface Distribution
Returns:
the mean

getVariance

public double getVariance()
Returns the variance.

Specified by:
getVariance in interface Distribution
Returns:
the variance

getStandardDeviation

public double getStandardDeviation()
Returns the standard deviation.

Specified by:
getStandardDeviation in interface Distribution
Returns:
the standard deviation

getXinf

public double getXinf()
Returns xa such that the probability density is 0 everywhere outside the interval [xa, xb].

Returns:
lower limit of support

getXsup

public double getXsup()
Returns xb such that the probability density is 0 everywhere outside the interval [xa, xb].

Returns:
upper limit of support

setXinf

public void setXinf(double xa)
Sets the value xa = xa, such that the probability density is 0 everywhere outside the interval [xa, xb].

Parameters:
xa - lower limit of support

setXsup

public void setXsup(double xb)
Sets the value xb = xb, such that the probability density is 0 everywhere outside the interval [xa, xb].

Parameters:
xb - upper limit of support

SSJ
V. 2.6.

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