SSJ
V. 2.6.

umontreal.iro.lecuyer.probdist
Class KolmogorovSmirnovDistQuick

java.lang.Object
  extended by umontreal.iro.lecuyer.probdist.ContinuousDistribution
      extended by umontreal.iro.lecuyer.probdist.KolmogorovSmirnovDist
          extended by umontreal.iro.lecuyer.probdist.KolmogorovSmirnovDistQuick
All Implemented Interfaces:
Distribution

public class KolmogorovSmirnovDistQuick
extends KolmogorovSmirnovDist

Extends the class KolmogorovSmirnovDist for the distribution. The methods of this class are much faster than those of class KolmogorovSmirnovDist.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
decPrec
 
Constructor Summary
KolmogorovSmirnovDistQuick(int n)
          Constructs a distribution with parameter n.
 
Method Summary
 double barF(double x)
          Returns the complementary distribution function.
static double barF(int n, double x)
          Computes the complementary distribution P[Dn >= x] with parameter n, in a form that is more precise in the upper tail, using the program described in.
 double cdf(double x)
          Returns the distribution function F(x).
static double cdf(int n, double x)
          Computes the distribution function u = P[Dn <= x] with parameter n, using the program described in.
 double density(double x)
          Returns f (x), the density evaluated at x.
static double density(int n, double x)
          Computes the density for the distribution with parameter n.
 double inverseF(double u)
          Returns the inverse distribution function x = F-1(u).
static double inverseF(int n, double u)
          Computes the inverse x = F-1(u) of the distribution F(x) with parameter n.
 
Methods inherited from class umontreal.iro.lecuyer.probdist.KolmogorovSmirnovDist
getN, getParams, setN, toString
 
Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
getMean, getStandardDeviation, getVariance, getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsup
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KolmogorovSmirnovDistQuick

public KolmogorovSmirnovDistQuick(int n)
Constructs a distribution with parameter n.

Method Detail

density

public double density(double x)
Description copied from class: ContinuousDistribution
Returns f (x), the density evaluated at x.

Overrides:
density in class KolmogorovSmirnovDist
Parameters:
x - value at which the density is evaluated
Returns:
density function evaluated at x

cdf

public double cdf(double x)
Description copied from interface: Distribution
Returns the distribution function F(x).

Specified by:
cdf in interface Distribution
Overrides:
cdf in class KolmogorovSmirnovDist
Parameters:
x - value at which the distribution function is evaluated
Returns:
distribution function evaluated at x

barF

public double barF(double x)
Description copied from class: ContinuousDistribution
Returns the complementary distribution function. The default implementation computes bar(F)(x) = 1 - F(x).

Specified by:
barF in interface Distribution
Overrides:
barF in class KolmogorovSmirnovDist
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 class: ContinuousDistribution
Returns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].

Specified by:
inverseF in interface Distribution
Overrides:
inverseF in class KolmogorovSmirnovDist
Parameters:
u - value at which the inverse distribution function is evaluated
Returns:
the inverse distribution function evaluated at u

density

public static double density(int n,
                             double x)
Computes the density for the distribution with parameter n.


cdf

public static double cdf(int n,
                         double x)
Computes the distribution function u = P[Dn <= x] with parameter n, using the program described in. This method uses Pomeranz's recursion algorithm and the Durbin matrix algorithm for n <= 500, which returns at least 13 decimal digits of precision. It uses the Pelz-Good asymptotic expansion in the central part of the range for n > 500 and returns at least 7 decimal digits of precision everywhere for 500 < n <= 100000. For n > 100000, it returns at least 5 decimal digits of precision for all u > 10-16, and a few correct decimals when u <= 10-16. This method is much faster than method cdf of KolmogorovSmirnovDist for moderate or large n. Restriction: n >= 1.


barF

public static double barF(int n,
                          double x)
Computes the complementary distribution P[Dn >= x] with parameter n, in a form that is more precise in the upper tail, using the program described in. It returns at least 10 decimal digits of precision everywhere for all n <= 500, at least 6 decimal digits of precision for 500 < n <= 200000, and a few correct decimal digits (1 to 5) for n > 200000. This method is much faster and more precise for x close to 1, than method barF of KolmogorovSmirnovDist for moderate or large n. Restriction: n >= 1.


inverseF

public static double inverseF(int n,
                              double u)
Computes the inverse x = F-1(u) of the distribution F(x) with parameter n.


SSJ
V. 2.6.

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