[R] Overdispersed poisson - negative observation
peter.fledelius@wgo.royalsun.com
peter.fledelius at wgo.royalsun.com
Thu Jan 16 16:53:02 CET 2003
Dear R users
I have been looking for functions that can deal with overdispersed poisson
models. Some (one) of the observations are negative. According to actuarial
literature (England & Verall, Stochastic Claims Reserving in General
Insurance , Institute of Actiuaries 2002) this can be handled through the
use of quasi likelihoods instead of normal likelihoods. The presence of
negatives is not normal in a poisson model, however, we see them frequently
in this type of data, and we would like to be able to fit the model anyway.
At the moment R is complaining about negative values and the link function
= log.
My code looks like this. Do any of you know if this problem can be solved
in R? Any suggestions are welcomed.
Kind regards,
Peter Fledelius (new R user)
*********** Code ************
paym <- c(5012, 3257, 2638, 898, 1734, 2642, 1828, 599, 54, 172,
106, 4179, 1111, 5270, 3116, 1817, -103, 673, 535,
3410, 5582, 4881, 2268, 2594, 3479, 649, 603,
5655, 5900, 4211, 5500, 2159, 2658, 984,
1092, 8473, 6271, 6333, 3786, 225,
1513, 4932, 5257, 1233, 2917,
557, 3463, 6956, 1368,
1351, 5596, 6165,
3133, 2262,
2063)
alpha <- factor(c(1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,
5,5,5,5,5,5,
6,6,6,6,6,
7,7,7,7,
8,8,8,
9,9,
10))
beta <- factor(c(1,2,3,4,5,6,7,8,9,10,
1,2,3,4,5,6,7,8,9,
1,2,3,4,5,6,7,8,
1,2,3,4,5,6,7,
1,2,3,4,5,6,
1,2,3,4,5,
1,2,3,4,
1,2,3,
1,2,
1))
d.AD <- data.frame(paym, alpha, beta)
glm.qD93 <- glm(paym ~ alpha + beta, family=quasipoisson())
glm.qD93
************ Code end ***************
More information about the R-help
mailing list