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
glm.control
says it: there you can specify anepsilon
and the iterations converges when $|dev-dev_{old}|/(dev + 0.1) < \epsilon$. "dev" means Deviance. Themaxit
option specifies the maximum number of iterations. If the algorithm hasn't converged aftermaxit
iterations, the partial output is given as well as an error message. $\endgroup$