You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Luc Maisonobe (JIRA)" <ji...@apache.org> on 2011/03/23 21:07:05 UTC

[jira] [Closed] (MATH-371) PearsonsCorrelation.getCorrelationPValues() precision limited by machine epsilon

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

Luc Maisonobe closed MATH-371.
------------------------------


Closing issue as it was included in version 2.2, which has been released

> PearsonsCorrelation.getCorrelationPValues() precision limited by machine epsilon
> --------------------------------------------------------------------------------
>
>                 Key: MATH-371
>                 URL: https://issues.apache.org/jira/browse/MATH-371
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Kevin Childs
>             Fix For: 2.1
>
>
> Similar to the issue described in MATH-201, using PearsonsCorrelation.getCorrelationPValues() with many treatments results in p-values that are continuous down to 2.2e-16 but that drop to 0 after that.
> In MATH-201, the problem was described as such:
> > So in essence, the p-value returned by TTestImpl.tTest() is:
> > 
> > 1.0 - (cumulativeProbability(t) - cumulativeProbabily(-t))
> > 
> > For large-ish t-statistics, cumulativeProbabilty(-t) can get quite small, and cumulativeProbabilty(t) can get very close to 1.0. When 
> > cumulativeProbability(-t) is less than the machine epsilon, we get p-values equal to zero because:
> > 
> > 1.0 - 1.0 + 0.0 = 0.0
> The solution in MATH-201 was to modify the p-value calculation to this:
> > p = 2.0 * cumulativeProbability(-t)
> Here, the problem is similar.  From PearsonsCorrelation.getCorrelationPValues():
>   p = 2 * (1 - tDistribution.cumulativeProbability(t));
> Directly calculating the p-value using identical code as PearsonsCorrelation.getCorrelationPValues(), but with the following change seems to solve the problem:
>   p = 2 * (tDistribution.cumulativeProbability(-t));

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira