umontreal.iro.lecuyer.probdist
Class KolmogorovSmirnovDistQuick
- java.lang.Object
-
- umontreal.iro.lecuyer.probdist.ContinuousDistribution
-
- umontreal.iro.lecuyer.probdist.KolmogorovSmirnovDist
-
- umontreal.iro.lecuyer.probdist.KolmogorovSmirnovDistQuick
-
- All Implemented Interfaces:
- Distribution
public class KolmogorovSmirnovDistQuick extends KolmogorovSmirnovDist
Extends the classKolmogorovSmirnovDistfor the distribution. The methods of this class are much faster than those of classKolmogorovSmirnovDist.
-
-
Field Summary
-
Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
decPrec
-
-
Constructor Summary
Constructors Constructor and Description KolmogorovSmirnovDistQuick(int n)Constructs a distribution with parameter n.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublebarF(double x)Returns the complementary distribution function.static doublebarF(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.doublecdf(double x)Returns the distribution function F(x).static doublecdf(int n, double x)Computes the distribution function u = P[Dn <= x] with parameter n, using the program described in.doubledensity(double x)Returns f (x), the density evaluated at x.static doubledensity(int n, double x)Computes the density for the distribution with parameter n.doubleinverseF(double u)Returns the inverse distribution function x = F-1(u).static doubleinverseF(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
-
-
-
-
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:ContinuousDistributionReturns f (x), the density evaluated at x.- Overrides:
densityin classKolmogorovSmirnovDist- 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:DistributionReturns the distribution function F(x).- Specified by:
cdfin interfaceDistribution- Overrides:
cdfin classKolmogorovSmirnovDist- 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:ContinuousDistributionReturns the complementary distribution function. The default implementation computes bar(F)(x) = 1 - F(x).- Specified by:
barFin interfaceDistribution- Overrides:
barFin classKolmogorovSmirnovDist- 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:ContinuousDistributionReturns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].- Specified by:
inverseFin interfaceDistribution- Overrides:
inverseFin classKolmogorovSmirnovDist- 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 <= 140, 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 > 140 and returns at least 5 decimal digits of precision everywhere for 140 < 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. For a given n > 140, the precision increases as x increases. This method is much faster than method cdf ofKolmogorovSmirnovDistfor 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 <= 140, at least 5 decimal digits of precision for 140 < n <= 200000, and a few correct digits (1 to 5) for n > 200000. This method is much faster and more precise for x close to 1, than method barF ofKolmogorovSmirnovDistfor 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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG