Learn R Programming

tweedie (version 3.0.17)

tweedie_convert: 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)

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)

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\).

Examples

Run this code
### 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)

Run the code above in your browser using DataLab