ptweedie_inversion: Fourier Inversion Evaluation for the Tweedie Distribution...

View source: R/ptweedie_inversion.R

ptweedie_inversionR Documentation

Fourier Inversion Evaluation for the Tweedie Distribution Function

Description

Evaluates the distribution function (df) 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 in the case of evaluation problems.

Usage

ptweedie_inversion(q, mu, phi, power, verbose = FALSE, details = FALSE, IGexact = TRUE)

ptweedie.inversion(q, power, mu, phi, verbose, details)

Arguments

q

vector of quantiles.

mu

the mean parameter.

phi

the dispersion parameter.

power

the power parameter p.

verbose

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

details

logical; if TRUE, returns the value of the distribution and some information about 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

If details = FALSE, a numeric vector of the distribution function values; if details = TRUE, a list containing CDF (a vector of the values of the distribution function) and regions (a vector of the number of integration regions used).

For special cases of p (i.e., p = 0, 1, 2, 3), where no inversion is needed, regions is set to NA for all values of q. For special cases of q for other values of p (i.e., P(Y = 0)), regions is set to NA.

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.

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

Examples

# Plot a Tweedie distribution function
y <- seq(0.01, 4, length = 50)
Fy <- ptweedie_inversion(y, mu = 1, phi = 1, power = 1.1)
plot(y, Fy, type = "l", lwd = 2, ylab = "Distribution function")


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