|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.probdist.ContinuousDistribution umontreal.iro.lecuyer.probdist.HypoExponentialDist umontreal.iro.lecuyer.probdist.HypoExponentialDistQuick
public class HypoExponentialDistQuick
This class is a subclass of HypoExponentialDist
and also implements the hypoexponential distribution. It uses
different algorithms to compute the probabilities.
The formula for the complementary distribution
is mathematically equivalent to (see and)
The expression is much faster to compute than the matrix exponential formula, but it becomes numerically unstable when k gets large and/or the differences between the λi are too small, because it is an alternating sum with relatively large terms of similar size. When the λi are close, many of the factors λj - λi in are small, and the effect of this is amplified when k is large. This gives rise to large terms of opposite sign in the sum and the formula becomes unstable due to subtractive cancellation. For example, with the computations done in standard 64-bit floating-point arithmetic, if the λi are regularly spaced with differences of λi+1 - λi = 0.1 for all i, the formula breaks down already for k = 15, while if the differences λi+1 - λi = 3, it gives a few decimal digits of precision for k up to = 300.
The formula for the density is mathematically equivalent to the much faster formula
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution |
---|
decPrec |
Constructor Summary | |
---|---|
HypoExponentialDistQuick(double[] lambda)
Constructs a HypoExponentialDistQuick object, with rates λi = lambda[i - 1], i = 1,…, k. |
Method Summary | |
---|---|
double |
barF(double x)
Returns the complementary distribution function. |
static double |
barF(double[] lambda,
double x)
Computes the complementary distribution bar(F)(x), with λi = lambda[i - 1], i = 1,…, k. |
double |
cdf(double x)
Returns the distribution function F(x). |
static double |
cdf(double[] lambda,
double x)
Computes the distribution function F(x), with λi = lambda[i - 1], i = 1,…, k. |
double |
density(double x)
Returns f (x), the density evaluated at x. |
static double |
density(double[] lambda,
double x)
Computes the density function f (x), with λi = lambda[i - 1], i = 1,…, k. |
double |
inverseF(double u)
Returns the inverse distribution function x = F-1(u). |
static double |
inverseF(double[] lambda,
double u)
Computes the inverse distribution function F-1(u), with λi = lambda[i - 1], i = 1,…, k. |
void |
setLambda(double[] lambda)
Sets the values λi =lambda[i - 1], i = 1,…, k for this object. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.probdist.HypoExponentialDist |
---|
cdf2, getLambda, getMean, getMean, getParams, getStandardDeviation, getStandardDeviation, getVariance, getVariance |
Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution |
---|
getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsup |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HypoExponentialDistQuick(double[] lambda)
lambda
- rates of the hypoexponential distributionMethod Detail |
---|
public double density(double x)
ContinuousDistribution
density
in class HypoExponentialDist
x
- value at which the density is evaluated
public double cdf(double x)
Distribution
cdf
in interface Distribution
cdf
in class HypoExponentialDist
x
- value at which the distribution function is evaluated
public double barF(double x)
ContinuousDistribution
barF
in interface Distribution
barF
in class HypoExponentialDist
x
- value at which the complementary distribution function is evaluated
public double inverseF(double u)
ContinuousDistribution
inverseF
in interface Distribution
inverseF
in class HypoExponentialDist
u
- value at which the inverse distribution function is evaluated
public static double density(double[] lambda, double x)
lambda
- rates of the hypoexponential distributionx
- value at which the density is evaluated
public static double cdf(double[] lambda, double x)
lambda
- rates of the hypoexponential distributionx
- value at which the distribution is evaluated
public static double barF(double[] lambda, double x)
lambda
- rates of the hypoexponential distributionx
- value at which the complementary distribution is evaluated
public static double inverseF(double[] lambda, double u)
lambda
- rates of the hypoexponential distributionu
- value at which the inverse distribution is evaluated
public void setLambda(double[] lambda)
HypoExponentialDist
setLambda
in class HypoExponentialDist
public String toString()
toString
in class HypoExponentialDist
|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |