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

Gilad commented on MATH-1179:
-----------------------------

Thank you for the quick reply.
I read the java doc thoroughly, and fully understand that performance on the 
monte carlo implementation is poorer than the asymptotic distribution.
However, it still seems extremely slow. For example, I added an attachment with 
two vectors which give the following results:
Java MonteCarlo p value = 0.207 (approximately 4 second calculation)
Java approximate p value = 0.286 (several miliseconds)

R p value = 0.217 (several miliseconds)

The R result seems much closer to the monte carlo result than the asymptotic 
distribution, however it is calculated extremely fast.
Therefore the current situation is that the Monte Carlo method is too slow, 
whereas the approximate method is too inaccurate.

Do you have any suggestions as to parameter adjustments or any other way to get 
results closer to what is provided by R?

> 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
>         Attachments: 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