FUNCTION REFERENCE
kstest
One-sample Kolmogorov-Smirnov goodness-of-fit test.
One-sample Kolmogorov-Smirnov goodness-of-fit test.
Syntax
[h,p,ksstat,cv] = kstest(x[,'CDF',cdf,'Alpha',a,'Tail',tail])Vector observations are compared with the standard normal CDF or an increasing two-column [x F] table, interpolated linearly. Observations outside the table range cause an error. NaNs are removed. Tail is unequal (two-sided), larger or smaller. h is logical. cv solves p(cv)=Alpha within Alpha 0.01 to 0.2 (two-sided) or 0.005 to 0.1 (one-sided), and is NaN outside these ranges. Legacy positional CDF, alpha and tail are accepted.
Example
[h,p,d,cv] = kstest([-1.2 -0.4 0.1 0.7 1.4])Differences from MATLAB: p uses the full Marsaglia-Tsang-Wang matrix method up to order 1001, then the Pelz-Good series; one-sided p uses the exact Smirnov sum. Distribution objects are not supported yet. Undefined p gives logical false h.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.