<< distfun_ksinv Kolmogorov-Smirnov distfun_ksrnd >>

distfun >> distfun > Kolmogorov-Smirnov > distfun_kspdf

distfun_kspdf

Kolmogorov-Smirnov PDF

Calling Sequence

y = distfun_kspdf(x,N)

Parameters

x :

a matrix of doubles, the outcome. x in [0,1]

N :

a matrix of doubles , the number of observations. N belongs to the set {1,2,3,4,.......,2147483647}

y :

a matrix of doubles, the probability density.

Description

Computes the probability distribution function of the Kolmogorov-Smirnov distribution function.

Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.

Examples

// Check with x scalar, N scalar, pr scalar
y = distfun_kspdf(0.274,10)
expected = 0.0175879

// Plot the function
scf();
x = linspace(0,1);
y1 = distfun_kspdf(x,5);
plot(x,y1,"b-")
y2 = distfun_kspdf(x,10);
plot(x,y2,"g-")
y3 = distfun_kspdf(x,20);
plot(x,y3,"r-")
legend(["N=5","N=10","N=20"]);
xtitle("Kolmogorov-Smirnov PDF","x","P(X=x)")

Bibliography

http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test

Authors


Report an issue
<< distfun_ksinv Kolmogorov-Smirnov distfun_ksrnd >>