Alex Herbert created NUMBERS-169:
------------------------------------

             Summary: Function to evaluate the complement of the RegularizedBeta
                 Key: NUMBERS-169
                 URL: https://issues.apache.org/jira/browse/NUMBERS-169
             Project: Commons Numbers
          Issue Type: New Feature
          Components: gamma
    Affects Versions: 1.0
            Reporter: Alex Herbert


The RegularizedBeta class computes the regularized beta function I(x, a, b). 
There is a functional identity for this:

{code:java}
1 - I(x, a, b) = I(1 - x, b, a)
{code}
See [Wolfram Regularized Incomplete Beta 
Identities|https://functions.wolfram.com/06.21.17.0008.01]

The RegularizedBeta class currently exploits this identity to compute the value 
by switching to call '1.0 - value(1 - x, b, a)' depending on the parameters.

I suggest a complement for this function to compute 1 - I(x, a, b):

{code:java}
public class RegularizedBetac {
    public static double value(double x,
                               final double a,
                               final double b,
                               double epsilon,
                               int maxIterations);     
}
{code}

This can call RegularizedBeta.value using the same inversion logic and avoid a 
potential computation of the complement using multiple inversions with loss of 
precision:

{noformat}
1 - I(x, a, b) == 1 - [ 1 - I(1 - x, b, a) ] = I(1 - x, b, a)

or

I(1 - x, b, a) == 1 - I(x, a, b) = 1 - [ 1 - I(1 - x, b, a) ]
{noformat}


 



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

Reply via email to