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

Phil Steitz commented on MATH-282:
----------------------------------

Thanks, Luc! 

Here is the perhaps strange logic explaining the odd exception nesting that you 
pointed out.  When a cumulativeProbability function returns NaN in the context 
of estimating inverse cum, the immediate exception is really a 
bad-value-returned exception, not a FunctionEvaluationException - there is no 
exception encountered evaluating the function, it just returns a bad value - so 
I code it as MathException.  The exception that the caller gets is 
FunctionEvaluationException, because there is in fact an error evaluating the 
inverse cum.  Wrapped inside is the MathException with the message indicating 
that NaN was returned by a cum activation.   

I guess it comes down to how we view FunctionEvaluationException and in 
particular is it appropriate to throw when NaN is returned by a method that 
logically should not return NaNs.  Thinking some more about this, I think so, 
so I will change the patch to throw FunctionEvaluationException in the first 
incidence.

Thanks again for looking at this carefully.  I am glad I got the translations 
right - the one I was worried about was as much English as French - "diverge to 
NaN" makes me cringe a little ;)

> 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
>            Assignee: Phil Steitz
>             Fix For: 2.1
>
>         Attachments: distributions.patch, 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