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

Phil Steitz commented on MATH-1179:
-----------------------------------

A note on exactP,  As pointed out in [1], if the combined dataset (two samples 
merged) contains ties, the permutation-based method used by exactP is not 
correct.  That's why R gives a warning when you ask for exact p-values in the 
presence of ties.  In [1] a more sophisticated Monte Carlo method is presented 
for dealing with the presence of ties.  The naive implementation we currently 
have (unless and until we find reference to and replace it with the Jenrich-Kim 
method) might actually be correct in the presence of ties if we insert the ties 
in the data from which the combinatorial enumeration is done or just use the 
actual data instead of n + m as an integer to compute the full set of possible 
D values.

A good general reference on the 2-sample statistic is [2], but that is 
unfortunately not freely available. 

[1] http://www.cirano.qc.ca/files/publications/2001s-56.pdf
[2] http://dx.doi.org/10.1080/01621459.1969.10501082

> kolmogorovSmirnovTest poor performance in monteCarloP method
> ------------------------------------------------------------
>
>                 Key: MATH-1179
>                 URL: https://issues.apache.org/jira/browse/MATH-1179
>             Project: Commons Math
>          Issue Type: Bug
>            Reporter: Gilad
>             Fix For: 4.0
>
>         Attachments: KSTest-JavaAndR.txt, KSTestSnippet.txt
>
>
> I'm using the kolmogovSmirnovTest method to calculate pvalues.
> However, when i try running the test on two double[] of sizes 5 and 45 the 
> results take over 10 seconds to calculate.
> This seems very long, whereas in R it takes a few miliseconds for the same 
> calculation.
> I'd be very happy to hear any comment you may have on the subject.
>    Gilad



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to