[ 
https://issues.apache.org/jira/browse/MATH-282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luc Maisonobe updated MATH-282:
-------------------------------

    Attachment: math-282.patch

The problem seems to be related to numerical accuracy.
The computation here involves lots of iterations in the Gamma.regularizedGammaP 
method (115 iterations on my computer) and the final expression involves 
several transcendant functions (exp, log and logGamma).

The proposed patch simply filters out the values exceeding 1.0 in the gamma 
distribution implementation which is used by Chi squared distribution.

I am not sure this is the best fix to this issue, so I won't commit it myself. 
I prefer someone else could verify it.

> ChiSquaredDistributionImpl.cumulativeProbability > 1
> ----------------------------------------------------
>
>                 Key: MATH-282
>                 URL: https://issues.apache.org/jira/browse/MATH-282
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 1.0, 1.1, 1.2, 2.0
>         Environment: called from Scala code
>            Reporter: Adam Kiezun
>             Fix For: 2.1
>
>         Attachments: math-282.patch
>
>
> Calling 
> new ChiSquaredDistributionImpl(1.0).cumulativeProbability(66.41528551683048)
> returns 1.000000000000004, which is bogus (should never be > 1)

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

Reply via email to