You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mikkel Meyer Andersen (JIRA)" <ji...@apache.org> on 2010/12/29 13:35:45 UTC

[jira] Commented: (MATH-437) Kolmogorov Smirnov Distribution

    [ https://issues.apache.org/jira/browse/MATH-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975771#action_12975771 ] 

Mikkel Meyer Andersen commented on MATH-437:
--------------------------------------------

In the past months, I've communicated with both Richard Simard and George Marsaglia regarding small disagreement between theory in Marsaglia's article and the actual implementation; namely the fact that 0 <= h < 1, but in the code 0 < h <= 1. I wrote to Marsaglia regarding this, and his answer was: 
{quote}
The Kolmogorov distribution comes from a piecewise polynomial in h with knots at 1/2n, 2/2n,...,(2n-1)/2n,  with each segment assumed to start with h=0. Although I emphasized that 0<= h <1 in the article,  I overlooked the need for ensuring that in the C code, and apparently so did my colleagues. Sorry about that.
{quote}
This means that his code has to be changed slightly to ensure that 0 <= h < 1. Simard argues that this shouldn't mean anything because KS distribution is continuous, but if one wants to correct it, one should
{quote}
Instead of taking the floor(n*d + 1) and making this correction for h = 1, take the ceiling (n*d).
{quote}

I would prefer using ceiling (n*d) instead of the originally (wrongly) proposed floor(n*d + 1), despite arguments of continuity. So my plan is to do this (I still have my implementation which seem to work quite okay). The only problem is that R seems to use Marsaglia's code, and I don't have access to e.g. Mathematica which should implement several algorithms, so I might run into problems when I have to perform tests.

> Kolmogorov Smirnov Distribution
> -------------------------------
>
>                 Key: MATH-437
>                 URL: https://issues.apache.org/jira/browse/MATH-437
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Mikkel Meyer Andersen
>            Assignee: Mikkel Meyer Andersen
>            Priority: Minor
>             Fix For: 3.0
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> Kolmogorov-Smirnov test (see [1]) is used to test if one sample against a known probability density functions or if two samples are from the same distribution. To evaluate the test statistic, the Kolmogorov-Smirnov distribution is used. Quite good asymptotics exist for the one-sided test, but it's more difficult for the two-sided test.
> [1]: http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.