[ https://issues.apache.org/jira/browse/MATH-1185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14270433#comment-14270433 ]
Sriram Natarajan commented on MATH-1185:
----------------------------------------
Apache Math has the required function to calculate the tail probability directly and exactly.
import org.apache.commons.math3.special.Gamma
Gamma.regularizedGammaQ(11.5,65.5) gives the tail probability as 4.199075982358542E-17
The first parameter is half the degrees of freedom (23/2) and the second parameter is critical_value/2 (131/2).
The proposed
public double oneMinusCumulativeProbability(double x);
can be implemented using Gamma.regularizedGammaQ
Credit to Robert Dodier:
http://stackoverflow.com/questions/27773499/why-does-tail-probability-in-apache-math-drop-to-zero-after-1e-16
> 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)