Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.probdist
Class KolmogorovSmirnovDist

    java.lang.Object
      umontreal.iro.lecuyer.probdist.ContinuousDistribution
          umontreal.iro.lecuyer.probdist.KolmogorovSmirnovDist

All Implemented Interfaces:
  Distribution

Direct Known Subclasses:
  KolmogorovSmirnovDistQuick

    public class KolmogorovSmirnovDist

extends ContinuousDistribution

Extends the class `ContinuousDistribution` for the Kolmogorov-Smirnov distribution with parameter n. Given an empirical distribution Fn with n independent observations and a continuous distribution F(x), the two-sided statistic is defined as

Dn = sup-∞ <= x <= ∞| Fn(x) - F(x)| = {Dn+, Dn-},

where Dn+ and Dn- are the + and - statistics as defined in equations and on page of this guide. This class implements a high precision version of the distribution P[Dn <= x]; it is a Java translation of the C program written in. According to its authors, it should give at least seven decimal digits of precision. It may be astronomically slow for large values of n.

Field Summary

Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
`decPrec`

Constructor Summary
`KolmogorovSmirnovDist(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 function bar(F)(x) with parameter n.
`double` | `cdf(double x)` Returns the distribution function F(x).
`static double` | `cdf(int n, double x)` Computes the distribution function F(x) with parameter n.
`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.
`int` | `getN()` Returns the parameter n of this object.
`double[]` | `getParams()` Returns an array containing the parameter n of this object.
`double` | `inverseF(double u)` Computes and returns the inverse distribution function x = F-1(u), by calling the method `inverseBrent`.
`static double` | `inverseF(int n, double u)` Computes the inverse x = F-1(u) of the distribution F(x) with parameter n.
`void` | `setN(int n)` Sets the parameter n of this object.
`String` | `toString()`

Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
`getMean, getStandardDeviation, getVariance, inverseBisection, inverseBrent`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### KolmogorovSmirnovDist

    public KolmogorovSmirnovDist(int n)

  Constructs a distribution with parameter n. Restriction: n >= 1.

Method Detail

### density

    public double density(double x)

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

  Specified by:
    `density` in class `ContinuousDistribution`
  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).

  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), which is not accurate when F(x) -> 1.

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

  Specified by:
    `inverseF` in interface `Distribution`
  Overrides:
    `inverseF` in class `ContinuousDistribution`
  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 F(x) with parameter n.

### barF

    public static double barF(int n,
                              double x)

  Computes the complementary distribution function bar(F)(x) with parameter n.

### inverseF

    public static double inverseF(int n,
                                  double u)

  Computes the inverse x = F-1(u) of the distribution F(x) with parameter n.

### getN

    public int getN()

  Returns the parameter n of this object.

### setN

    public void setN(int n)

  Sets the parameter n of this object.

### getParams

    public double[] getParams()

  Returns an array containing the parameter n of this object.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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