pdfgdd | R Documentation |
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.
pdfgdd(x, para, paracheck=TRUE, silent=TRUE, ...)
x |
A real value vector. |
para |
The parameters from |
paracheck |
A logical controlling whether the parameters are checked for validity. |
silent |
The argument of |
... |
Additional argument to pass. |
Probability density (f
) for x
.
W.H. Asquith
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")}.
cdfgdd
, quagdd
, lmomgdd
, pargdd
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.