Evaluates the probability density function (pdf) for Tweedie distributions using Fourier inversion,
for given values of the dependent variable y, the mean mu, dispersion phi, and power parameter power.
Not usually called by general users, but can be used in the case of evaluation problems.
dtweedie_inversion(y, mu, phi, power, method = 3, verbose = FALSE,
details = FALSE, IGexact = TRUE)dtweedie.inversion(y, power, mu, phi, method = 3, verbose, details)
A numeric vector of densities if details=FALSE; if details = TRUE, a list containing denisty (a vector of the values of the density), regions (a vector of the number of integration regions used),method (a vector giving the evaluation method used; see the Note below on the three methods), and exitstatus (a vector, where a 1 for any value means a computational problem or target relative accuracy not reached, for the corresponding observation).
vector of quantiles.
the mean parameter \(\mu\).
the dispersion parameter \(\phi\).
scalar; the power parameter \(p\).
the method to use; one of 1, 2, or 3 (the default).
logical; if TRUE, display some internal computation details. The default is FALSE.
logical; if TRUE, return a list with basic details of the integration. The default is FALSE.
logical; if TRUE (the default), evaluate the inverse Gaussian distribution using the 'exact' values, otherwise uses inversion.
Dunn, P. K. and Smyth, G. K. (2008). Evaluation of Tweedie exponential dispersion model densities by Fourier inversion. Statistics and Computing, 18, 73--86. tools:::Rd_expr_doi("10.1007/s11222-007-9039-6")
Dunn, P. K. and Smyth, G. K. (2008). Evaluation of Tweedie exponential dispersion model densities by Fourier inversion. Statistics and Computing, 18, 73--86. tools:::Rd_expr_doi("10.1007/s11222-007-9039-6")
# Plot a Tweedie density
y <- seq(0.02, 4, length = 50)
fy <- dtweedie_inversion(y, mu = 1, phi = 1, power = 1.1)
plot(y, fy, type = "l", lwd = 2, ylab = "Density")
Run the code above in your browser using DataLab