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

Luc Maisonobe commented on MATH-1185:
-------------------------------------

Yes, there is a reason: it is due to the subtraction, not the the distribution.
When you compute 1.0 - x, you are limited with IEEE754 double precision. If x 
is close to 1.0, the subtraction
leads to loss of significance (also called catastrophic cancellation). What you 
see here is that the last
number just below 1.0 is 1.0 - 2^-53. In other words, there are no 
representable number between 1.0-2^-53 and 1.0.
Then, when subtraction is computed, you jump from 2^-53 to 0.

> Tail probability drops to zero beyond 10e-17 ?
> ----------------------------------------------
>
>                 Key: MATH-1185
>                 URL: https://issues.apache.org/jira/browse/MATH-1185
>             Project: Commons Math
>          Issue Type: Wish
>    Affects Versions: 3.3, 3.4
>            Reporter: Sriram Natarajan
>            Priority: Minor
>
> This could be a  simple question, In which case I can expect a clarification. 
> If this is the wrong place to post such a question, let me know.
> OS: Windows 8.1, Java 1.8.0_25
> ChiSquaredDistribution chisq = new ChiSquaredDistribution(23)
> 1.0 - chisq.cumulativeProbability(130) is  1.1102230246251565E-16
> 1.0 - chisq.cumulativeProbability(131) is  0.0  
> Am pretty sure it is not a formatting issue.  Is there a reason why the tail 
> drops to zero at this point?



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

Reply via email to