Learn R Programming

dwp (version 1.1)

incGamma: Incomplete Gamma Function

Description

Incomplete Gamma Function

Usage

incGamma(a, x, lower = FALSE)

Value

scalar or vector of length = max(length(x), length(a)), with values of the shorter recycled to match the length of the longer a la pnorm etc.

Arguments

a

positive numeric vector

x

non-negative numeric vector

lower

boolean for calculating lower or upper incomplete gamma function

Details

The upper incomplete gamma function, following Wolfram Alpha, namely, incGamma(a, x) = \(\int_x^\infty e^{-t} * t^{a - 1}dt\), calculated using pgamma. Within the dwp package, incGamma is used in the calculation of the cumulative distribution function (CDF) of the xep02 distribution (pxep02). NOTE: The function pracma::incgam also calculates incomplete gamma with pracma::incgam(x, a) = incGamma(a, x), but pracma::incgam is not vectorized and not used here.