Example usage for org.apache.commons.math3.special Gamma regularizedGammaP

List of usage examples for org.apache.commons.math3.special Gamma regularizedGammaP

Introduction

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

Prototype

public static double regularizedGammaP(double a, double x, double epsilon, int maxIterations) 

Source Link

Document

Returns the regularized gamma function P(a, x).

Usage

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

@Override
public Double apply(Double x) {
    try {/*  ww  w  . j  ava  2 s .  com*/
        return Gamma.regularizedGammaP(_a, x, _eps, _maxIter);
    } catch (MaxCountExceededException e) {
        throw new MathException(e);
    }
}

From source file:tools.ChiSquared.java

public static double pValue(double chiSquared, long nbDegreesOfFreedom, double epsilon) {
    if (chiSquared <= 0.0) {
        return 1.0;
    } else {/*from  w ww .  ja  v  a  2  s  . c  o m*/
        return 1.0 - Gamma.regularizedGammaP(nbDegreesOfFreedom / 2.0, chiSquared / 2.0, epsilon,
                Integer.MAX_VALUE);
    }
}