heavy (version 0.38.196)

pgamma.deriv: Derivatives of the regularized incomplete gamma function

Description

Computes the incomplete gamma function and its first and second derivatives with respect to 'shape' parameter.

Usage

pgamma.deriv(x, shape, scale, deriv = 0:2)

Arguments

x

a numeric argument, x > 0.

shape, scale

shape and scale parameters, must be positive.

deriv

integer vector, order of the required derivatives.

Value

Function pgamma.deriv returns the value, first and second derivatives of the regularized incomplete gamma gamma function with respect to 'shape' parameter.

Details

The regularized (standard) incomplete gamma function is given by $$P(a, x) = \frac{1}{\Gamma(a)} \int_0^x t^{a - 1}\,e^{-t}\,dt,$$ which is related with the CDF of Gamma distribution (see pgamma).

pgamma.deriv is a C translation of the original Fortran AS 187 subroutine by R.J. Moore.

References

Abramowitz, M., and Stegun, I.A. (1970). Handbook of Mathematical Functions. Dover, New York.

Moore, R.J. (1982). Algorithm AS 187: Derivatives of the incomplete gamma integral. Applied Statistics 31, 330-335.

See Also

pgamma, psigamma

Examples

Run this code
# NOT RUN {
  x <- 3
  pgamma.deriv(x, 1, 1, deriv = 0:2)

  # only to check 1st element
  pgamma(x, 1, 1)

# }

Run the code above in your browser using DataLab