Learn R Programming

tweedie (version 3.0.17)

dtweedie_inversion: Fourier Inversion Evaluation for the Tweedie Probability Function

Description

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.

Usage

dtweedie_inversion(y, mu, phi, power, method = 3, verbose = FALSE, 
                          details = FALSE, IGexact = TRUE)

dtweedie.inversion(y, power, mu, phi, method = 3, verbose, details)

Value

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).

Arguments

y

vector of quantiles.

mu

the mean parameter \(\mu\).

phi

the dispersion parameter \(\phi\).

power

scalar; the power parameter \(p\).

method

the method to use; one of 1, 2, or 3 (the default).

verbose

logical; if TRUE, display some internal computation details. The default is FALSE.

details

logical; if TRUE, return a list with basic details of the integration. The default is FALSE.

IGexact

logical; if TRUE (the default), evaluate the inverse Gaussian distribution using the 'exact' values, otherwise uses inversion.

References

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")

Examples

Run this code
# 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