
SSJ V. 1.2.5. 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object umontreal.iro.lecuyer.gof.FDist
public class FDist
This class provides methods to compute (or approximate) the distribution functions of various types of goodnessoffit test statistics. All the methods in this class return F(x) for some probability distribution. Recall that the distribution function of a continuous random variable X with density f is
Most distributions are implemented only in standardized form here, i.e., with the location parameter set to 0 and the scale parameter set to 1. To shift the distribution by x_{0} and rescale by c, it suffices to replace x by (x  x_{0})/c in the argument when calling the function.
Method Summary  

static double 
andersonDarling(int N,
double x)
Returns P[A_{N}^{2} <= x], where A_{N}^{2} is the AndersonDarling statistic for a sample of independent uniforms over (0, 1). 
static double 
cramerVonMises(int N,
double x)
Returns an approximation of P[W_{N}^{2} <= x], where W_{N}^{2} is the Cramérvon Mises statistic for a sample of independent uniforms over (0, 1). 
static double 
kolmogorovSmirnov(int N,
double x)
Returns p(x) = P[D_{N} <= x], where D_{N} = max(D_{N}^{+}, D_{N}^{}) is the twosided KolmogorovSmirnov statistic for a sample of size N. 
static double 
kolmogorovSmirnovPlus(int N,
double x)
Returns p(x) = P[D_{N}^{+} <= x], the distribution function of the positive KolmogorovSmirnov statistic. 
static double 
kolmogorovSmirnovPlusJumpOne(int N,
double a,
double x)
Similar to kolmogorovSmirnovPlus but for the case where the distribution
function F has a jump of size a at a given point x_{0},
is zero at the left of x_{0},
and is continuous at the right of x_{0}. 
static double 
scan(int N,
double d,
int m)
Returns F(m), the distribution function of the scan statistic with parameters N and d, evaluated at m. 
static double 
watsonG(int N,
double x)
Returns an approximation of P[G_{N} <= x], where G_{N} is the Watson statistic defined in watsonU ,
for a sample of independent uniforms over (0, 1). 
static double 
watsonU(int N,
double x)
Returns P[U^{2} <= x], where U^{2} is the Watson statistic in the limit when N > ∞, for a sample of independent uniforms over (0, 1). 
Methods inherited from class java.lang.Object 

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Method Detail 

public static double kolmogorovSmirnovPlus(int N, double x)
GofStat
.
The relative error on
p(x) = P[D_{N}^{+} <= x] is always less than
10^{5}, and the relative error on 1  p(x) is less than
10^{1} when
1  p(x) > 10^{10}.
The absolute error on 1  p(x) is less than 10^{11}
when
1  p(x) < 10^{10}.
N
 sample sizex
 positive or negative KolmogorovSmirnov statistic
public static double kolmogorovSmirnov(int N, double x)
Warning: for 1 < N < 10 or x in the lower tail, the approximation is bad. But the precision is at least 1 decimal digit nearly everywhere.
N
 sample sizex
 KolmogorovSmirnov statistic
public static double kolmogorovSmirnovPlusJumpOne(int N, double a, double x)
kolmogorovSmirnovPlus
but for the case where the distribution
function F has a jump of size a at a given point x_{0},
is zero at the left of x_{0},
and is continuous at the right of x_{0}.
Restriction: 0 < a < 1.
N
 sample sizea
 size of the jumpx
 positive or negative KolmogorovSmirnov statistic
public static double cramerVonMises(int N, double x)
N
 sample sizex
 Cramérvon Mises statistic
public static double watsonU(int N, double x)
N
 sample sizex
 Watson statistic
public static double watsonG(int N, double x)
watsonU
,
for a sample of independent uniforms over (0, 1).
The approximation is computed in a similar way as for
cramerVonMises
.
To implement this method, a table of the values of
g(x) = lim_{N > ∞}P[G_{N} <= x] and of its derivative
was first computed by numerical integration.
For x <= 1.5, the method uses this table with cubic spline
interpolation.
For x > 1.5, it uses the empirical curve
g(x) = 1  e^{1920x}.
A correction of order
1/(N)^{1/2}, obtained
empirically from 10^{7} simulation runs with N = 256 and also
implemented as an interpolation table with an exponential tail,
is then added.
The absolute error is estimated to be less than
0.01, 0.005, 0.002, 0.0008, 0.0005, 0.0005, 0.0005 for
N = 16, 32, 64, 128, 256, 512, 1024, respectively.
N
 sample sizex
 Watson statistic
public static double andersonDarling(int N, double x)
cramerVonMises
.
To implement this method, an interpolation table of the values of
g(x) = lim_{N > ∞}P[A_{N}^{2} <= x]
was first computed by numerical integration.
Then a linear correction in 1/N, obtained by simulation, was added.
For x <= 5.0, the method approximates
g_{N}(x) = P[A_{N}^{2} <= x] by
interpolation. For x > 5.0 (the tail of the distribution),
it uses the empirical curve
g_{N}(x) = 1  e^{1.06x0.56}  e^{1.06x1.03}/N,
which includes an empirical correction in 1/N.
The absolute error on g_{N}(x) is estimated to be
less than 0.001 for N > 6.
For N = 2, 3, 4, 6, it is estimated to be
less than 0.04, 0.01, 0.005, 0.002, respectively.
For N = 1, the method returns the exact value,
g_{N}(x) = (1  4e^{x1})^{1/2} for
x >= ln(4)  1.
N
 sample sizex
 AndersonDarling statistic
public static double scan(int N, double d, int m)
scan
,
which computes its complementary distribution
bar(F)(m) = 1  F(m  1).
N
 sample size ( >= 2)d
 length of the test interval (∈(0, 1))m
 scan statistic

SSJ V. 1.2.5. 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 