The log likelihood for Tweedie models
logLiktweedie( glm.obj, dispersion=NULL)
Returns the log-likelihood from the specified model
a fitted Tweedie glm
object
the dispersion parameter NULL
which means to use an estimate
Peter Dunn (pdunn2@usc.edu.au)
The log-likelihood is computed from the AIC,
so see AICtweedie
for more details.
Dunn, P. K. and Smyth, G. K. (2008). Evaluation of Tweedie exponential dispersion model densities by Fourier inversion. Statistics and Computing, 18, 73--86. tools:::Rd_expr_doi("10.1007/s11222-007-9039-6")
Dunn, Peter K and Smyth, Gordon K (2005). Series evaluation of Tweedie exponential dispersion model densities Statistics and Computing, 15(4). 267--280. tools:::Rd_expr_doi("10.1007/s11222-005-4070-y")
Jorgensen, B. (1997). Theory of Dispersion Models. Chapman and Hall, London.
Sakamoto, Y., Ishiguro, M., and Kitagawa G. (1986). Akaike Information Criterion Statistics. D. Reidel Publishing Company.
AICtweedie
library(statmod) # Needed to use tweedie family object
### Generate some fictitious data
test.data <- rgamma(n=200, scale=1, shape=1)
### Fit a Tweedie glm and find the AIC
m1 <- glm( test.data~1, family=tweedie(link.power=0, var.power=2) )
### A Tweedie glm with p=2 is equivalent to a gamma glm:
m2 <- glm( test.data~1, family=Gamma(link=log))
### The models are equivalent, so the AIC shoud be the same:
logLiktweedie(m1)
logLik(m2)
Run the code above in your browser using DataLab