Learn R Programming

⚠️There's a newer version (3.0.17) of this package.Take me there.

tweedie

The tweedie package allows likelihood computations for Tweedie distributions.

Apart from special cases (the normal, Poisson, gamma, inverse Gaussian distributions), Tweedie distributions do not have closed-form density functions or distribution functions. This package uses fast numerical algorithms (infinite oscillation integrals; infinite series) to evaluate the Tweedie density functions and distribution functions.

Installation

You can install the development version of tweedie from GitHub with:

# install.packages("pak")
pak::pak("PeterKDunn/tweedie")

Tweedie distributions

Tweedie distributions are exponential dispersion models, with a mean $\mu$ and a variance $\phi \mu^\xi$, for some dispersion parameter $\phi > 0$ and a power index $\xi$ (sometimes called $p$) that uniquely defines the distribution within the Tweedie family (for all real values of $\xi$ not between 0 and 1).

Special cases of the Tweedie distributions are:

  • the normal distribution, with $\xi = 0$ (i.e., the variance is $\phi$ and not related to the mean);
  • the Poisson distribution, with $\xi = 1$ and $\phi = 1$ (i.e., the variance is the same as the mean);
  • the gamma distribution, with $\xi = 2$; and
  • the inverse Gaussian distribution, with $\xi = 3$.

For all other values of $\xi$, the probability functions and distribution functions have no closed forms.

For $\xi < 1$, applications are limited (non-existent so far?), but have support on the entire real line and $\mu > 0$.

For $1 < \xi < 2$, Tweedie distributions can be represented as a Poisson sum of gamma distributions. These distributions are continuous for $Y > 0$ but have a discrete mass at $Y = 0$.

For $\xi \ge 2$, the distributions have support on the positive reals.

The vignette contains examples.

Copy Link

Version

Install

install.packages('tweedie')

Monthly Downloads

16,098

Version

3.0.15

License

GPL (>= 2)

Maintainer

Peter K Dunn

Last Published

February 26th, 2026

Functions in tweedie (3.0.15)

ptweedie_series

Series Evaluation for the Tweedie Distribution Function
tweedie_AIC

AIC for Tweedie Glms
tweedie_convert

Tweedie Distribution: Convert Between Parameter Formats
logLiktweedie

Log-likelihood for Tweedie distributions
tweedie_dev

Unit Deviance for a Tweedie Distribution
tweedie_lambda

The Probability of Observing a Zero Value for a Tweedie Density
tweedie_plot

Plot Tweedie Models
dtweedie_series

Series Evaluation for the Tweedie Probability Function
dtweedie_saddle

Tweedie densities evaluation using the saddlepoint approximation
tweedie_integrand

Display Integrand Information for Tweedie Fourier inversion
Tweedie

Tweedie distributions
ptweedie_inversion

Fourier Inversion Evaluation for the Tweedie Distribution Function
tweedie_profile

Profile Likelihood Estimate of Tweedie Variance Index Parameter
dtweedie_inversion

Fourier Inversion Evaluation for the Tweedie Probability Function
tweedie-package

Evaluation of Tweedie Exponential Family Models