1
$\begingroup$

it happened to me that in a logistic regression in R with glm the Fisher scoring iterations in the output are less than the iterations selected with the argument control=glm.control(maxit=25) in glm itself.

I see this as the effect of divergence in the iteratively reweighted least squares algorithm behind glm.

My question is: under which criteria does glm stop the iterations and provides with a partial output? I was thinking about something like "when the new coefficients-old coefficients < epsilon, then STOP". Is this the case? If not, what does make glm stop? Thanks, Avitus

$\endgroup$
  • $\begingroup$ Hi @Avitus: The help page of glm.control says it: there you can specify an epsilon and the iterations converges when $|dev-dev_{old}|/(dev + 0.1) < \epsilon$. "dev" means Deviance. The maxit option specifies the maximum number of iterations. If the algorithm hasn't converged after maxit iterations, the partial output is given as well as an error message. $\endgroup$ – COOLSerdash Jun 5 '13 at 14:02
  • $\begingroup$ Hi @COOLSerdash: your comment is actually an answer :-) I find it very helpful, thanks. One short silly question: what is the Deviance in glm.control? Is it the Deviance in en.wikipedia.org/wiki/Deviance_(statistics)? $\endgroup$ – Avitus Jun 5 '13 at 14:08
  • $\begingroup$ Yes, that's exactly the Deviance. Maybe this and this will clarify Deviance further? $\endgroup$ – COOLSerdash Jun 5 '13 at 14:10
  • $\begingroup$ @COOLSerdash: COOL links! Thank you very much. All I need now is to think about the choice of Deviance as parameter to stop or continue the iterations and gently ask you to edit your comment above into a question to upvote it :) $\endgroup$ – Avitus Jun 5 '13 at 14:15
5
$\begingroup$

In glm.control you can specify a positive $\epsilon$ which is used to decide whether the algorithm has converged or not. The documentation page of glm.control states that the algorithm converges if

$$ \frac{|dev - dev_{old}|}{(|dev| + 0.1)} < \epsilon $$ Where "dev" means Deviance. These three resources maybe helpful in clarifying Deviance: first, second, third.

$\endgroup$

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.