Logistic regression on separated data never converges
The slope grows by 2.0 per IRLS iteration, from 4.6 to 44.7, while the deviance falls by a factor of about each step.
slope
deviance
| Quantity | Viv | Checked by |
|---|---|---|
slopes | [4.56317, 14.6977, 24.6997, … ] (5 values) | from 10 iterations on, every 5 more add between 9.5 and 10.5 to the slope |
deviance factor | 2.71839 | the deviance falls by a factor between 2.6 and 2.8 per iteration |
logistic_separation.viv
Output · native build · Oct 14, 2026 · 0.88 s
slopes: [4.56317, 14.6977, 24.6997, 34.6997, 44.6995] deviances: [0.393253, 0.00257254, 1.73217e-05, 1.16713e-07, 7.86478e-10] slope_per_iteration: 2.00012 deviance_factor: 2.71839
- ✓ from 10 iterations on, every 5 more add between 9.5 and 10.5 to the slope
- ✓ the deviance falls by a factor between 2.6 and 2.8 per iteration
Open in the workbenchAtlasMore statistics claims
- Full statement
- On ten completely separated points ( exactly when ), logistic regression by IRLS (R's glm.fit) has no finite estimate to converge to. From 5 to 25 iterations the slope grows by 2.0 per iteration (between 9.5 and 10.5 per 5 iterations, from 4.6 to 44.7) while the deviance falls by a factor between 2.6 and 2.8, about , per iteration (from 0.39 to ), so a fit stopped by a deviance test reports a large slope that only measures how long it ran.
- Scope
- Ten points, to 10, exactly when , an intercept and a slope, logit link; the IRLS iteration is run for a fixed number of steps (convergence test off) to watch it. R stops it at 25 iterations by default with the warning "fitted probabilities numerically 0 or 1 occurred".
- Reference
- R 4.3.3's glm.fit, which lib/stats/glm follows step for step (agreement to on eight of R's datasets, lib/stats/glm_check.json, including a separated fit); Albert and Anderson, "On the existence of maximum likelihood estimates in logistic regression models", Biometrika 71 (1984) 1-10: with completely separated data the maximum likelihood estimate does not exist.
claims/stats/logistic_separation.viv#61fdf0a1ba