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

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


                    method="interpolation",do.ci=TRUE,do.smooth=TRUE,do.plot=TRUE) # Estimating p

Any idea?

  • $\begingroup$ Sorry about that. I fixed it. $\endgroup$ – user9292 Nov 30 '14 at 6:39
  • $\begingroup$ In addition to the error, I get 10 warning messages when I run your code. How many do you get? $\endgroup$ – Glen_b Nov 30 '14 at 7:10
  • $\begingroup$ library(statmod) solves the problem I had. $\endgroup$ – Glen_b Nov 30 '14 at 7:16

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



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.

  • $\begingroup$ Many thanks! Why it is not worth the trouble? In what sense? $\endgroup$ – user9292 Nov 30 '14 at 7:34
  • 1
    $\begingroup$ There are lots of zeros. These tend only to be likely with reasonably small $p$ unless the mean gets really small (smaller as p grows -- even a single zero is impossible at $p=2$), so the likelihood isn't going to go up - we expect it to start dropping dramatically as we get closer to 2. You can see where the peak is, so what purpose is served by knowing a more accurate value for the likelihood at $p=1.9$? It might be interesting to see if you can get convergence, but in respect of the data set, you won't learn anything other than $p$ isn't up near 1.9, which is already clear. $\endgroup$ – Glen_b Nov 30 '14 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.