pdfgdd: Probability Density Function of the Gamma Difference...

pdfgddR Documentation

Probability Density Function of the Gamma Difference Distribution

Description

This function computes the probability density of the Gamma Difference distribution (Klar, 2015) given parameters (\alpha_1 > 0, \beta_1 > 0, \alpha_2 > 0, \beta_2 > 0) computed by pargdd.

f(x, x > 0) = c e^{+\beta_2x}\int_{+x}^\infty z^{\alpha_1-1} (z-x)^{\alpha_2 - 1} e^{-(\beta_1+\beta_2)z}\, \mathrm{d}z\mbox{,}

and

f(x, x < 0) = c e^{-\beta_1x}\int_{-x}^\infty z^{\alpha_2-1} (z+x)^{\alpha_1 - 1} e^{-(\beta_1+\beta_2)z}\, \mathrm{d}z\mbox{,}

where c is defined as

c = \frac{\beta_1^{\alpha_1} \beta_2^{\alpha_2}}{\Gamma(\alpha_1) \Gamma(\alpha_2)}\mbox{,}

where \Gamma(y) is the complete gamma function.

Usage

pdfgdd(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

Probability density (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

cdfgdd, quagdd, lmomgdd, pargdd

Examples

## Not run: 
x <- seq(-8, 8, by=0.01) # the operations on x are to center
para <- list(para=c(3,   1, 1, 1), type="gdd")
plot(x-(3  /1 - 1/1), pdfgdd(x, para), type="l", xlim=c(-6,6), ylim=c(0, 0.7),
     xlab="x", ylab="density of gamma difference distribution")
para <- list(para=c(2,   1, 1, 1), type="gdd")
lines(x-(2  /1 - 1/1), pdfgdd(x, para), lty=2)
para <- list(para=c(1,   1, 1, 1), type="gdd")
lines(x-(1  /1 - 1/1), pdfgdd(x, para), lty=3)
para <- list(para=c(0.5, 1, 1, 1), type="gdd")
lines(x-(0.5/1 - 1/1), pdfgdd(x, para), lty=4) # 
## End(Not run)

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