Individual Bernoulli deviance need not have a chi-squared calibration (source code)

= Individual Bernoulli deviance need not have a chi-squared calibration
{title2=$D=-2\ell(\widehat\beta)$}

A <logistic regression> fitted to ungrouped <Bernoulli> observations has <residual deviance> $D=-2\ell(\widehat\beta)$. Comparing it automatically with $\chi^2_{n-p}$ is generally invalid: the saturated dimension grows with $n$, with one observation per fitted probability. If the true model has only an intercept and success probability $1/2$, then $D/n\to2\log2$, whereas $\chi^2_{n-1}/n\to1$. Fixed-dimensional nested-model <likelihood-ratio tests> can still use <Wilks theorem> under regularity. For absolute fit, use meaningful grouping, residual diagnostics, or a fitted-model <parametric bootstrap>.