[SciPy-user] new Kolmogorov-Smirnov test

josef.pktd@gmai... josef.pktd@gmai...
Wed Dec 3 13:24:24 CST 2008


On Wed, Dec 3, 2008 at 12:35 PM, Roban Hultman Kramer
<roban@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