| Title: | Tweedie Distribution |
|---|---|
| Description: | Provides density, distribution function, quantile function, and random generation for the Tweedie distribution under the compound Poisson-Gamma parameterisation with power parameter in (1, 2). The density is evaluated using the series expansion of Dunn and Smyth (2005) <doi:10.1007/s11222-005-4070-y>, implemented in C++ via 'Rcpp' and 'RcppArmadillo' for performance. |
| Authors: | Stefano Damato [aut, cre] |
| Maintainer: | Stefano Damato <[email protected]> |
| License: | LGPL (>= 3) |
| Version: | 0.2.0 |
| Built: | 2026-09-30 07:20:58 UTC |
| Source: | https://github.com/stefanodamato/tweediedistr |
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.
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 )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 )
n |
number of observations. If |
mean |
vector of means. |
dispersion |
vector of dispersion parameters. |
power |
vector of power parameters. |
x, q
|
vector of quantiles. |
log, log.p
|
logical; if |
lower.tail |
logical; if |
p |
vector of probabilities. |
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 . It has
and
, where is mean,
is dispersion, and is power.
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.
Dunn, P. K., & Smyth, G. K. (2005). Series evaluation of Tweedie exponential dispersion model densities. Statistics and Computing, 15(4), 267–280. doi:10.1007/s11222-005-4070-y.