[SciPy-user] new Kolmogorov-Smirnov test
josef.pktd at gmail.com
josef.pktd at gmail.com
Wed Dec 3 14:24:24 EST 2008
On Wed, Dec 3, 2008 at 12:35 PM, Roban Hultman Kramer
<roban at astro.columbia.edu> wrote:
> Is there a correct two-sample k-s test in scipy?
>
in scipy.stats.stats
def ks_2samp(data1, data2):
""" Computes the Kolmogorov-Smirnof statistic on 2 samples. Modified
from Numerical Recipies in C, page 493. Returns KS D-value, prob. Not
ufunc- like.
Returns: KS D-value, p-value
It uses the special.kolmogorov which is the asymptotic two-sided
distribution. It "looks" ok, but there are no tests for it, and I
haven't tested it either.
A quick Monte Carlo with your sample size would verify how accurate it is.
Josef
More information about the SciPy-User
mailing list