


lyngby_ks_prob - Kolmogorov-Smirnov probability
function P = lyngby_ks_prob(M, tol)
Input: M The Kolmogorov-Smirnov test value
tol (optional) {eps} precision required for
the convergence. The default value is MATLAB's
eps.
This function computes the function that enters
into the calculation of the significance level in a
Kolmogorov-Smirnov test.
+oo
.-- [ k-1 2 2 ]
Q (x) = 2 > [ (-1) exp(-2.x .k ) ]
KS '-- [ ]
k=1
The probability is calculated from an infinite series. If a
term in the series is lower than 'tol' the iteration will stop.
The algorithm will maximal use 100 terms.
The probability is close to one the algorithm will use many
terms for the convergence. The user might want to lower the
value of 'tol' to get a faster (though less precise)
computation in the case where many data point have a
probability close to one.
Ref.: Numerical Recipes, 2nd ed. pp.623-628
See also: lyngby_ks_test, lyngby_ks_main