tweedie: Tweedie Distribution Functions

tweedieR Documentation

Tweedie Distribution Functions

Description

Density, distribution function, quantile function and random generation for the Tweedie distribution with mean equal to mean, dispersion equal to dispersion, and power equal to power.

Usage

rtweedie(n, mean = 1, dispersion = 1, power = 1.5)

dtweedie(x, mean = 1, dispersion = 1, power = 1.5, log = FALSE)

ptweedie(
  q,
  mean = 1,
  dispersion = 1,
  power = 1.5,
  lower.tail = TRUE,
  log.p = FALSE
)

qtweedie(
  p,
  mean = 1,
  dispersion = 1,
  power = 1.5,
  lower.tail = TRUE,
  log.p = FALSE
)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

mean

vector of means.

dispersion

vector of dispersion parameters.

power

vector of power parameters.

x, q

vector of quantiles.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P[X \le x]; otherwise, P[X > x].

p

vector of probabilities.

Details

If mean, dispersion, or power are not specified they assume the default values of 1, 1, and 1.5, respectively.

The Tweedie distribution used here follows the compound Poisson-Gamma parameterisation with power parameter in (1, 2). It has \mathbb{E}[X] = \mu and \mathrm{Var}(X) = \phi\mu^p, where \mu is mean, \phi is dispersion, and p is power.

Value

dtweedie gives the density, ptweedie gives the distribution function, qtweedie gives the quantile function, and rtweedie generates random samples.

The length of the result is determined by n for rtweedie, and is the maximum of the lengths of the numerical arguments for the other functions.

The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

References

Dunn, P. K., & Smyth, G. K. (2005). Series evaluation of Tweedie exponential dispersion model densities. Statistics and Computing, 15(4), 267–280. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11222-005-4070-y")}.


tweedieDistr documentation built on July 23, 2026, 5:07 p.m.