tweedie_convert: Tweedie Distribution: Convert Between Parameter Formats

View source: R/tweedie_convert.R

tweedie_convertR Documentation

Tweedie Distribution: Convert Between Parameter Formats

Description

Converts from the fitted glm parameters p, \mu and \phi and the corresponding underlying Poisson and gamma parameters (when 1 < p < 2).

Usage

tweedie_convert(xi = NULL, mu, phi, power = NULL)

tweedie.convert(xi = NULL, mu, phi, power = NULL)

Arguments

xi

a synonym for power.

mu

the mean parameter \mu.

phi

the dispersion parameter \phi.

power

the power parameter p; a synonym for \xi.

Value

a list of the parameters of the parameters of the corresponding underlying Poisson and gamma densities: poisson.lambda (\lambda from the underlying Poisson distribution), gamma.shape, gamma.scale (the shape and scale parameters from the underlying gamma distribution), p0 (the probability that Y = 0), gamma.mean and gamma.phi (the gamma mean and dispersion parameter values)

Examples

### Fit a Tweedie density
pretend <- data.frame( y = rgamma(20, shape = 1, rate = 1) )
fit <- glm(y ~ 1, data = pretend, 
           family = statmod::tweedie(link.power = 0, var.power = 1.4))

# Convert parameters
tweedie_convert(mu = fitted(fit, type="response"), phi = 1, power = 1.4)


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