cdfgdd: Cumulative Distribution Function of the Gamma Difference...

cdfgddR Documentation

Cumulative Distribution Function of the Gamma Difference Distribution

Description

This function computes the cumulative probability or nonexceedance probability of the Gamma Difference distribution (Klar, 2015) given parameters (\alpha_1 > 0, \beta_1 > 0, \alpha_2 > 0, \beta_2 > 0) computed by pargdd. The cumulative distribution function is complex and numerical integration is used.

F(x) = \frac{\beta_2^{\alpha_2}}{\Gamma(\alpha_1)\Gamma(\alpha_2)} \int_{\mathrm{max}\{0, -t\}}^\infty \!\!\!\!\!\!\!\!x^{\alpha_2 - 1} e^{-\beta_2x}\gamma\bigl(\alpha_1, \beta_1(x+t)\bigr)\,\mathrm{d}x\mbox{,}

where F(x) is the nonexceedance probability for quantile x \in (-\infty, \infty), \Gamma(y) is the complete gamma function, and \gamma(a, y) is the lower incomplete gamma function

\gamma(a, y) = \int_0^y t^{a-1}e^{-t}\,\mathrm{d}t\mbox{.}

The so-called Gamma Difference distribution is the distribution for the difference of two Gamma random variables X_1 \sim \Gamma(\alpha_1, \beta_1) and X_1 \sim \Gamma(\alpha_2, \beta_2); X = X_1 - X_2 is a Gamma Difference random variable. The distribution has other names in the literature.

Usage

cdfgdd(x, para, paracheck=TRUE, silent=TRUE, ...)

Arguments

x

A real value vector.

para

The parameters from pargdd or vec2par.

paracheck

A logical controlling whether the parameters are checked for validity.

silent

The argument of silent for the try() operation wrapped on integrate().

...

Additional argument to pass.

Value

Nonexceedance probability (F) for x.

Author(s)

W.H. Asquith

References

Klar, B., 2015, A note on gamma difference distributions: Journal of Statistical Computation and Simulation v. 85, no. 18, pp. 1–8, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00949655.2014.996566")}.

See Also

pdfgdd, quagdd, lmomgdd, pargdd

Examples

## Not run: 
x <- seq(-5, 7, by=0.01)
para <- list(para=c(3,   1, 1, 1), type="gdd")
plot(x, cdfgdd(x, para), type="l", xlim=c(-5,7), ylim=c(0, 1),
     xlab="x", ylab="distribution function of gamma difference distribution")
para <- list(para=c(2,   1, 1, 1), type="gdd")
lines(x, cdfgdd(x, para), lty=2)
para <- list(para=c(1,   1, 1, 1), type="gdd")
lines(x, cdfgdd(x, para), lty=3)
para <- list(para=c(0.5, 1, 1, 1), type="gdd")
lines(x, cdfgdd(x, para), lty=4) # 
## End(Not run)

wasquith/lmomco documentation built on Nov. 13, 2024, 4:53 p.m.