[ https://issues.apache.org/jira/browse/STATISTICS-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17383292#comment-17383292 ]
Alex Herbert commented on STATISTICS-31: ---------------------------------------- I've not looked over the PR in detail but I did notice that the new survival probability functions are tested with probabilities in the range 1e-7 to 1e-9 or so with a default absolute tolerance of 1e-15. Given the limit of 1 - CDF(x) is 2^-53 (or approximately 1.11e-16) did you try pushing the values and the resulting probabilities further out into the long tail? > 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)