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

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

It is a feature.

I just tried this example:
{code:java}
class BaseTest {
  @Test
  void test1() {
    // Pass
  }
  @Test
  void test2() {
    // Pass
  }
}

class ChildTest extends BaseTest {
  void test1() {
    Assertions.fail();
  }
}
{code}
If you excute {{ChildTest}} then it does not run test1. It only runs test2.

Inheritence is not the JUnit 5 way. However if you have a lot of boiler plate 
code then it is not too bad to put it all in a base class. I'd have to do more 
reading on this to see if there is a better way to have the tests for all the 
distributions fit the JUnit 5 way.

 

> 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