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

Alex Herbert commented on STATISTICS-31:
----------------------------------------

{quote}> tabulation changes (e.g. in {{BetaDistributionTest}}) that should 
rather belong in a dedicated PR

If I could I would, but I was getting formatting failures in the PR.
{quote}
Are you using an IDE to run checkstyle or just {{mvn checkstyle}}? You should 
not have to reformat what is current.
{quote}> did you try pushing the values and the resulting probabilities further 
out into the long tail?

For some of them I did do manual tests in an even longer tail and they passed 
fine. I can update the current values to push it out even further if desired. 
Having values < 0.1e-16 would require bumping up the absolute tolerance. 
{quote}
I would prefer to see probabilities that are just not possible with 1 - CDF. 
The test could even be updated to show 1 - CDF fails to compute the same value 
as it returns 0. This would require probabilities below 1e-22 (or 2^-106).

 

> Add survival probability function to continuous distributions
> -------------------------------------------------------------
>
>                 Key: STATISTICS-31
>                 URL: https://issues.apache.org/jira/browse/STATISTICS-31
>             Project: Apache Commons Statistics
>          Issue Type: New Feature
>            Reporter: Benjamin W Trent
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> It is useful to know the [survival 
> function|[https://en.wikipedia.org/wiki/Survival_function]] of a number given 
> a continuous distribution.
> While this can be approximated with
> {noformat}
> 1 - cdf(x){noformat}
> , there is an opportunity for greater accuracy in certain distributions.
>  
> A good example of this is the gamma distribution. The survival function for 
> that distribution would probably look similar to:
>  
> ```java
> @Override
>  public double survivalProbability(double x) {
>      if (x <= SUPPORT_LO)
> {         return 1;     }
> else if (x >= SUPPORT_HI)
> {         return 0;     }
>     return RegularizedGamma.Q.value(shape, x / scale);
>  }
> ```
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to