Learn R Programming

tweedie (version 2.3.5)

tweedie-package: Tweedie Distributions

Description

Functions for computing and fitting the Tweedie family of distributions

Arguments

Author

Peter K Dunn

Maintainer: Peter K Dunn <pdunn2@usc.edu.au>

Details

Package:tweedie
Type:Package
Version:2.3.2
Date:2017-12-14
License:GPL (>=2)

References

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")

Dunn, Peter K and Smyth, Gordon K (2001). Tweedie family densities: methods of evaluation. Proceedings of the 16th International Workshop on Statistical Modelling, Odense, Denmark, 2--6 July

Jorgensen, B. (1987). Exponential dispersion models. Journal of the Royal Statistical Society, B, 49, 127--162.

Jorgensen, B. (1997). Theory of Dispersion Models. Chapman and Hall, London.

Tweedie, M. C. K. (1984). An index which distinguishes between some important exponential families. Statistics: Applications and New Directions. Proceedings of the Indian Statistical Institute Golden Jubilee International Conference (Eds. J. K. Ghosh and J. Roy), pp. 579--604. Calcutta: Indian Statistical Institute.

Examples

Run this code
# Generate random numbers
set.seed(987654)
y <- rtweedie( 20, xi=1.5, mu=1, phi=1)
	# With Tweedie index  xi   between 1 and 2, this produces continuous
	# data with exact zeros
x <- rnorm( length(y), 0, 1)  # Unrelated predictor

# With exact zeros, Tweedie index  xi  must be between 1 and 2

# Fit the tweedie distribution; expect  xi  about 1.5
library(statmod)

xi.vec <- seq(1.1, 1.9, by=0.5)
out <- tweedie.profile( y~1, xi.vec=xi.vec, do.plot=TRUE, verbose=TRUE)

# Fit the glm
require(statmod) # Provides  tweedie  family functions
summary(glm( y ~ x, family=tweedie(var.power=out$xi.max, link.power=0) ))

Run the code above in your browser using DataLab