Example usage for org.apache.commons.math3.special Beta regularizedBeta

List of usage examples for org.apache.commons.math3.special Beta regularizedBeta

Introduction

In this page you can find the example usage for org.apache.commons.math3.special Beta regularizedBeta.

Prototype

public static double regularizedBeta(double x, final double a, final double b, double epsilon,
        int maxIterations) 

Source Link

Document

Returns the regularized beta function I(x, a, b).

Usage

From source file:com.opengamma.strata.math.impl.function.special.IncompleteBetaFunction.java

/**
 * Evaluates the function.//from ww w . j  ava2s  .  co  m
 * 
 * @param x  x
 * @return the value of the function
 * @throws IllegalArgumentException if $x < 0$ or $x > 1$
 */
@Override
public Double apply(Double x) {
    ArgChecker.isTrue(x >= 0 && x <= 1, "x must be in the range 0 to 1");
    try {
        return Beta.regularizedBeta(x, _a, _b, _eps, _maxIter);
    } catch (MaxCountExceededException e) {
        throw new MathException(e);
    }
}