[SciPy-Dev] scipy.stats.ks_2samp with weighted data

josef.pktd at gmail.com josef.pktd at gmail.com
Sat Apr 21 20:30:37 EDT 2018


On Sat, Apr 21, 2018 at 7:42 PM, Corin Hoad <corinhoad at gmail.com> wrote:

> Hello developers,
>
> I recently needed an implementation of the Kolmogorov-Smirnov 2 sample
> test which required the incorporation of a weight associated with each
> element of the data.  This lead me to this stackexchange answer
> https://stats.stackexchange.com/questions/193439/two-
> sample-kolmogorov-smirnov-test-with-weights where a procedure for a
> weighted 2-sample KS test is taken from Numerical Methods of Statistics by
> Monohan.
>
> My current implementation of this can be found here:
>
> https://github.com/brunel-physics/tact/blob/2b0ee2a28a30f014b103319118b64b
> e52070f001/tact/metrics.py#L198
>
> Would there by any interest in incorporating this functionality into scipy?
>

I have potentially two problems:

What's the definition or interpretation of the weights?

Is there distribution of the test statistic correct?
My guess is that it would change when weighting is introduced.
I didn't find much in a brief Google search.
Whether the distribution/p-value is correct could also be checked with the
rejection probabilities in a simulation.

Josef




>
> Yours,
>
> Corin Hoad
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20180421/8b620e1a/attachment.html>


More information about the SciPy-Dev mailing list