Solved – glm.fit: algorithm did not converge -Tweedie

convergencegeneralized linear modelrtweedie-distribution

I'm trying to estimate $p$ in tweedie regression, but I got the following message:

glm.fit: algorithm did not converge

I'm using public data from "GLMs for insurance data" book by Piet de Jong, and Gillian Z. Heller. Here is my code:

install.packages("sas7bdat") # A package to read SAS data set
library(sas7bdat)

mydata <- read.sas7bdat("http://www.businessandeconomics.mq.edu.au/our_departments/Applied_Finance_and_Actuarial_Studies/acst_docs/glms_for_insurance_data/data/claims_sas_miner.sas7bdat")
View(mydata) # Viewing the data


library(tweedie)

out=tweedie.profile(mydata$CLM_AMT~1,p.vec=seq(1.1,1.9,length=9),
                    method="interpolation",do.ci=TRUE,do.smooth=TRUE,do.plot=TRUE) # Estimating p

Any idea?

Best Answer

The fit at 1.9 doesn't converge but you don't need it, since it's nowhere near the optimum.

Try

 out=tweedie.profile(mydata$CLM_AMT~1,p.vec=seq(1.1,1.85,length=16),
                 method="interpolation",do.ci=TRUE,do.smooth=TRUE,do.plot=TRUE)

enter image description here

You could probably get it to converge by playing with some of the options (though the likelihood might not change all that much), but it's not worth the trouble.

Related Question