Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/base/special/gammaincinv/docs/types/index.d"

Index

Functions

Functions

Export assignment gammaincinv

  • gammaincinv(p: number, a: number, upper?: undefined | false | true): number
  • Inverts the lower gamma function; i.e., computes xr such that P(a,xr) = p.

    Notes

    • In contrast to a more commonly used definition, the first argument is the probability p and the second argument is the scale factor a.
    • By default, the function inverts the lower regularized incomplete gamma function, P(x,a). To invert the upper function Q(x,a), set the upper argument to true.
    • If provided p < 0 or p > 1, the function returns NaN.

    Parameters

    • p: number

      probability value

    • a: number

      scale parameter

    • Optional upper: undefined | false | true

      boolean indicating if the function should invert the upper tail of the incomplete gamma function instead; i.e., compute xr such that Q(a,xr) = p (default: false)

    Returns number

    function value of the inverse

    Example

    javascript var y = gammaincinv( 0.5, 2.0 ); // returns ~1.678

    Example

    javascript var y = gammaincinv( 0.1, 10.0 ); // returns ~6.221

    Example

    javascript var y = gammaincinv( 0.75, 3.0 ); // returns ~3.92

    Example

    javascript var y = gammaincinv( 0.75, 3.0, true ); // returns ~1.727

    Example

    javascript var y = gammaincinv( 0.75, NaN ); // returns NaN

    Example

    var y = gammaincinv( NaN, 3.0 );
    // returns NaN