# Logistic regression: Fisher's scoring iterations do not match the selected iterations in glm

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

• 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. Jun 5, 2013 at 14:02
• 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)? Jun 5, 2013 at 14:08
• Yes, that's exactly the Deviance. Maybe this and this will clarify Deviance further? Jun 5, 2013 at 14:10
• @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 :) Jun 5, 2013 at 14:15

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.