SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdist.KolmogorovSmirnovDistQuick Class Reference

Extends the class KolmogorovSmirnovDist for the Kolmogorov–Smirnov distribution. More...

Inheritance diagram for umontreal.ssj.probdist.KolmogorovSmirnovDistQuick:
umontreal.ssj.probdist.KolmogorovSmirnovDist umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution

Public Member Functions

 KolmogorovSmirnovDistQuick (int n)
 Constructs a Kolmogorov–Smirnov distribution with parameter \(n\).
double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\).
double cdf (double x)
 Returns the distribution function \(F(x)\).
double barF (double x)
 Returns the complementary distribution function.
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\).
Public Member Functions inherited from umontreal.ssj.probdist.KolmogorovSmirnovDist
 KolmogorovSmirnovDist (int n)
 Constructs a Kolmogorov–Smirnov distribution with parameter.
int getN ()
 Returns the parameter \(n\) of this object.
void setN (int n)
 Sets the parameter \(n\) of this object.
double[] getParams ()
 Returns an array containing the parameter \(n\) of this object.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.ContinuousDistribution
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 inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection.
double getMean ()
 Returns the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXinf (double xa)
 Sets the value \(x_a=\) xa, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXsup (double xb)
 Sets the value \(x_b=\) xb, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).

Static Public Member Functions

static double density (int n, double x)
 Computes the density for the Kolmogorov–Smirnov distribution with parameter \(n\).
static double cdf (int n, double x)
 Computes the Kolmogorov–Smirnov distribution function \(u = P[D_n \le x]\) with parameter \(n\), using the program described in.
static double barF (int n, double x)
 Computes the complementary Kolmogorov–Smirnov distribution.
static double inverseF (int n, double u)
 Computes the inverse \(x = F^{-1}(u)\) of the distribution.

Detailed Description

Extends the class KolmogorovSmirnovDist for the Kolmogorov–Smirnov distribution.

The methods of this class are much faster than those of class KolmogorovSmirnovDist.

Definition at line 39 of file KolmogorovSmirnovDistQuick.java.

Constructor & Destructor Documentation

◆ KolmogorovSmirnovDistQuick()

umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.KolmogorovSmirnovDistQuick ( int n)

Constructs a Kolmogorov–Smirnov distribution with parameter \(n\).

Definition at line 68 of file KolmogorovSmirnovDistQuick.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.barF ( double x)

Returns the complementary distribution function.

The default implementation computes \(\bar{F}(x) = 1 - F(x)\).

Parameters
xvalue at which the complementary distribution function is evaluated
Returns
complementary distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 80 of file KolmogorovSmirnovDistQuick.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.barF ( int n,
double x )
static

Computes the complementary Kolmogorov–Smirnov distribution.

\(P[D_n \ge x]\) with parameter \(n\), in a form that is more precise in the upper tail, using the program described in [208] . It returns at least 10 decimal digits of precision everywhere for all \(n \le500\), at least 6 decimal digits of precision for \(500 < n \le200000\), 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\ge1\).

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 412 of file KolmogorovSmirnovDistQuick.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.cdf ( double x)

Returns the distribution function \(F(x)\).

Parameters
xvalue at which the distribution function is evaluated
Returns
distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 76 of file KolmogorovSmirnovDistQuick.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.cdf ( int n,
double x )
static

Computes the Kolmogorov–Smirnov distribution function \(u = P[D_n \le x]\) with parameter \(n\), using the program described in.

[208] . This method uses Pomeranz’s recursion algorithm and the Durbin matrix algorithm [27], [198], [171]  for \(n \le500\), which returns at least 13 decimal digits of precision. It uses the Pelz-Good asymptotic expansion [196]  in the central part of the range for \(n > 500\) and returns at least 7 decimal digits of precision everywhere for \(500 < n \le100000\). For \(n > 100000\), it returns at least 5 decimal digits of precision for all \(u > 10^{-16}\), and a few correct decimals when \(u \le10^{-16}\). This method is much faster than method cdf of KolmogorovSmirnovDist for moderate or large \(n\). Restriction: \(n\ge1\).

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 379 of file KolmogorovSmirnovDistQuick.java.

◆ density() [1/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.density ( double x)

Returns \(f(x)\), the density evaluated at \(x\).

Parameters
xvalue at which the density is evaluated
Returns
density function evaluated at x

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 72 of file KolmogorovSmirnovDistQuick.java.

◆ density() [2/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.density ( int n,
double x )
static

Computes the density for the Kolmogorov–Smirnov distribution with parameter \(n\).

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 92 of file KolmogorovSmirnovDistQuick.java.

◆ inverseF() [1/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.inverseF ( double u)

Returns the inverse distribution function \(x = F^{-1}(u)\).

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 84 of file KolmogorovSmirnovDistQuick.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.KolmogorovSmirnovDistQuick.inverseF ( int n,
double u )
static

Computes the inverse \(x = F^{-1}(u)\) of the distribution.

\(F(x)\) with parameter \(n\).

Reimplemented from umontreal.ssj.probdist.KolmogorovSmirnovDist.

Definition at line 436 of file KolmogorovSmirnovDistQuick.java.


The documentation for this class was generated from the following file: