Dear developers, We now have a working implementation of the cdf for the two-sided Kolmogorov Smirnov Distribution [1]. What do you think about it? Now both rounding (RealMatrix and its cousins) and exact (using BigFraction and its cousins) are provided - the exact should only be used for verification purposes because its way too slow in practise. Should the exact be removed or should be JavaDoc just reflect this fact clearly? I like it being there - it also gives the user to possibility to use it for e.g. n <= 50. On the negative side, two pow-functions are required (no common superclass for FieldMatrix<T> and RealMatrix providing multiply-functionality - unfortunately).
Cheers, Mikkel. [1]: https://issues.apache.org/jira/browse/MATH-437 ---------- Forwarded message ---------- From: Mikkel Meyer Andersen (JIRA) <j...@apache.org> Date: 2010/11/16 Subject: [jira] Commented: (MATH-437) Kolmogorov Smirnov Distribution To: m...@mikl.dk [ https://issues.apache.org/jira/browse/MATH-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932361#action_12932361 ] Mikkel Meyer Andersen commented on MATH-437: -------------------------------------------- The last part of the roundedK kan be replaced with {{ double pFrac = Hpower.getEntry(k - 2, k - 2); for (int i = 1; i <= n; ++i) { pFrac *= (double)i / (double)n; } return pFrac; }} to get even better running time and still precise results: {{ F(n, x) = F(200, 0.02): Lecuyer (3.0 ms.) = 5.151982014280042E-6 KolmogorovSmirnovDistribution exact (760.0 ms.) = 5.15198201428005E-6 KolmogorovSmirnovDistribution !exact (16.0 ms.) = 5.151982014280049E-6 ------------------------- F(n, x) = F(200, 0.031111): Lecuyer (2.0 ms.) = 0.012916146481628863 KolmogorovSmirnovDistribution exact (51902.0 ms.) = 0.012149763742041911 KolmogorovSmirnovDistribution !exact (9.0 ms.) = 0.012149763742041922 ------------------------- F(n, x) = F(200, 0.04): Lecuyer (0.0 ms.) = 0.1067121882956352 KolmogorovSmirnovDistribution exact (5903.0 ms.) = 0.10671370113626812 KolmogorovSmirnovDistribution !exact (6.0 ms.) = 0.10671370113626813 ------------------------- }} > 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 > Attachments: KolmogorovSmirnovDistribution.java > > 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. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org