dtweedie_inversion: Fourier Inversion Evaluation for the Tweedie Probability...

View source: R/dtweedie_inversion.R

dtweedie_inversionR Documentation

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)

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.

Value

A numeric vector of densities if details=FALSE; if details=TRUE, return a list with density (the density values), regions (the number of integration regions used) and methods (which of the three methods was used).

Note

The 'exact' values for the inverse Gaussian distribution are not really exact, but evaluated using inverse normal distributions, for which very good numerical approximation are available in R. For special cases of p (i.e., p = 0, 1, 2, 3), where no inversion is needed, regions and method are set to NA for all values of y. For special cases of y for other values of p (i.e., P(Y = 0)), regions and method are set to NA.

The three methods are described in Dunn & Smyth (2008).

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. \Sexpr[results=rd]{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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11222-007-9039-6")}

Examples

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


tweedie documentation built on Feb. 7, 2026, 5:07 p.m.