Kolmogorov-Smirnov CDF
p = distfun_kscdf(x,N) p = distfun_kscdf(x,N,lowertail)
a matrix of doubles, the outcome. x in [0,1]
a matrix of doubles , the number of observations. N belongs to the set {1,2,3,4,.......,2147483647}
a 1-by-1 matrix of booleans, the tail (default lowertail=%t). If lowertail is true (the default), then considers P(X<=x) otherwise P(X>x).
a matrix of doubles, the probability.
Computes the cumulative distribution function of the Kolmogorov-Smirnov distribution function.
Computes
where
with
a set of n independent uniform [0,1) random variables sorted into increasing order.
Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.
computed = distfun_kscdf(0.274,10) expected = .6284796154565043 //Plot the function scf(); x = linspace(0.,0.5); p1=distfun_kscdf(x,5); p2=distfun_kscdf(x,10); p3=distfun_kscdf(x,20); plot(x,p1,"r-"); plot(x,p2,"b-"); plot(x,p3,"g-"); legend(["N=5","N=10","N=20"],2); xtitle("Kolmogorov Smirnov CDF","x","$P(D_n\leq x)$") | ![]() | ![]() |
http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test
Evaluating Kolmogorov’s Distribution, George Marsaglia, Wai Wan Tsang, Journal of Statistical Software, Vol. 8, Issue 18, Nov 2003