SSJ
V. 1.2.5.

umontreal.iro.lecuyer.probdist
Class ContinuousDistribution

java.lang.Object
  extended by umontreal.iro.lecuyer.probdist.ContinuousDistribution
All Implemented Interfaces:
Distribution
Direct Known Subclasses:
BetaDist, CauchyDist, ChiDist, ChiSquareDist, ExponentialDist, ExtremeValueDist, FatigueLifeDist, FisherFDist, GammaDist, HyperbolicSecantDist, InverseGaussianDist, JohnsonSBDist, JohnsonSUDist, LaplaceDist, LogisticDist, LoglogisticDist, LognormalDist, NormalDist, ParetoDist, Pearson5Dist, Pearson6Dist, PiecewiseLinearEmpiricalDist, StudentDist, TriangularDist, TruncatedDist, UniformDist, WeibullDist

public abstract class ContinuousDistribution
extends Object
implements Distribution

Classes implementing continuous distributions should inherit from this 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 of bar(F)(x) and of F-1(u), the latter using binary search to find the inverse of a generic distribution function F. The integer decPrec defines the target number of decimals of precision when approximating a distribution function, but there is no guarantee that this target is always attained.


Field Summary
 int decPrec
           
 
Constructor Summary
ContinuousDistribution()
           
 
Method Summary
 double barF(double x)
          Returns bar(F)(x) = 1 - F(x).
abstract  double density(double x)
          Returns f (x), the density of X evaluated at x.
 double inverseBisection(double u)
           
 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)
          Computes and returns the inverse distribution function F-1(u), defined in.
 
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, getMean, getStandardDeviation, getVariance
 

Field Detail

decPrec

public int decPrec
Constructor Detail

ContinuousDistribution

public ContinuousDistribution()
Method Detail

density

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

Parameters:
x - value at which the density is evaluated
Returns:
density 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). The calculations are done with an approximate precision of tol. Returns x = F-1(u).

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

barF

public double barF(double x)
Description copied from interface: Distribution
Returns 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

inverseF

public double inverseF(double u)
Description copied from interface: Distribution
Computes and returns the inverse distribution function F-1(u), defined in.

Specified by:
inverseF in interface Distribution
Parameters:
u - value in the interval (0, 1) for which the inverse distribution function is evaluated
Returns:
the inverse distribution function evaluated at u

inverseBisection

public double inverseBisection(double u)

SSJ
V. 1.2.5.

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