Learn R Programming

tweedie (version 3.2.2)

ptweedie_saddle: Tweedie CDF evaluation using the saddlepoint approximation

Description

Distribution function for the Tweedie EMDs using a saddlepoint approximation.

Usage

ptweedie_saddle(q, mu, phi, power, lower.tail = TRUE, log.p = FALSE)

Value

A numeric vector of densities.

Arguments

q

vector of quantiles.

mu

vector of mean \(\mu\).

phi

vector of dispersion parameters \(\phi\).

power

scalar; the value of \(p\) such that the variance is \(\mbox{var}[Y]=\phi\mu^{p}\).

lower.tail

logical; if TRUE (the default), computes the lower tail \(F(y)\); otherwise computes \(S(y) = 1 - F(y)\).

log.p

logical; if TRUE, probabilities are returned as \(\log(p)\). The default is FALSE.

References

Dunn, Peter K and Smyth, Gordon K (Submitted). Evaluation of the Tweedie exponential dispersion model distribution function. Submitted.

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, Peter K and Smyth, Gordon K (2005). Series evaluation of Tweedie exponential dispersion model densities Statistics and Computing, 15(4). 267--280. tools:::Rd_expr_doi("10.1007/s11222-005-4070-y")

Nelder, J. A. and Pregibon, D. (1987). An extended quasi-likelihood function Biometrika, 74(2), 221--232. tools:::Rd_expr_doi("10.1093/biomet/74.2.221")

Examples

Run this code
# Plot a Tweedie distribution function
y <- seq(0.01, 4, length = 50)
Fy <- ptweedie_saddle(y, power = 2.1, mu = 1, phi = 1)
plot(y, Fy, type = "l", lwd = 2, ylab = "CDF")


Run the code above in your browser using DataLab