View source: R/tweedie_convert.R
| tweedie_convert | R Documentation |
Converts from the fitted glm parameters p, \mu and \phi
and the corresponding underlying Poisson and gamma parameters (when 1 < p < 2).
tweedie_convert(xi = NULL, mu, phi, power = NULL)
tweedie.convert(xi = NULL, mu, phi, power = NULL)
xi |
a synonym for |
mu |
the mean parameter |
phi |
the dispersion parameter |
power |
the power parameter |
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)
### 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.