Exact Kolmogorov Test Distribution; Computing Times
- To: mathgroup at smc.vnet.net
- Subject: [mg21630] Exact Kolmogorov Test Distribution; Computing Times
- From: "Hermann Meier" <hmeier at webshuttle.ch>
- Date: Tue, 18 Jan 2000 02:35:16 -0500 (EST)
- Organization: EUnet AG, Switzerland. A KPNQwest Company.
- Sender: owner-wri-mathgroup at wolfram.com
The following program computes the exact distribution of the one-sample
Kolmogorov test stastistic (two-sided; see Birnbaum, Journal of the American
Statistical Association, Vol. 47, 1952, p. 425-441):
R[0, 0][y_] = 1;
R[j_, 0][y_] /; j != 0 = 0;
R[j_, k_][y_] /; Abs[j] >= y = 0;
R[j_, k_][y_] /; Abs[j] <= y - 1 := R[j, k][y] =
Exp[-1]*Sum[R[j + 1 - i, k - 1][y]/i!, {i, 0, 2*y - 1}];
cdfkolmog[n_,y_] := n!*Exp[n]*R[0, n][y]/n^n
Computing times (2x450 MHZ Pentium, 256 MB, Windows NT 4 SP 6):
N[cdfkolmog[50, 15]]//Timing
{8.235 Second, 0.9998264674}
(To compute all R's from scratch, I use Clear[R] and evaluate the first
program lines once more):
N[cdfkolmog[100,15]]//Timing
{26.172 Second, 0.9801607579}
Is there a possibility to speed up this programm (retaining infinite
precision) ? I would appreciate any suggestion.
With kind regards
Hermann Meier