Class Gamma

java.lang.Object
org.tribuo.util.infotheory.Gamma

public final class Gamma extends Object
Static functions for computing the Gamma and log Gamma functions on real valued inputs.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    gamma(double x)
    Function to calculate the value of a Gamma function.
    static double
    logGamma(double x)
    Function to calculate the log of a Gamma function.
    static double
    regularizedGammaP(int a, double x, double epsilon, int maxIterations)
    Computes the regularised partial gamma function P.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • logGamma

      public static double logGamma(double x)
      Function to calculate the log of a Gamma function. Negative integer values will return NaN.
      Parameters:
      x - The value to calculate for.
      Returns:
      The log of the Gamma function applied to x.
    • gamma

      public static double gamma(double x)
      Function to calculate the value of a Gamma function. Negative integer values will return NaN.
      Parameters:
      x - The value to calculate for.
      Returns:
      The value of the Gamma function applied to x.
    • regularizedGammaP

      public static double regularizedGammaP(int a, double x, double epsilon, int maxIterations)
      Computes the regularised partial gamma function P.

      See RegularisedGammaFunction. Throws IllegalStateException if the iterations don't converge.

      Parameters:
      a - shape (when used as a CDF)
      x - value / scale (when used as a CDF)
      epsilon - Tolerance.
      maxIterations - The maximum number of iterations.
      Returns:
      P(a,x).