A Small Dataset With Complete Separation
A concrete dataset makes the contrast between ordinary maximum likelihood and Firth correction visible in every calculation. Consider four independent binary observations, with predictor \(x\) and response \(Y\). Two observations have \(x=0\) and both have \(Y=0\); two have \(x=1\) and both have \(Y=1\). The predictor perfectly separates the outcomes: every observation in the first group is a failure, and every observation in the second group is a success.
| Predictor value | Number of observations | Number of successes |
|---|---|---|
| \(x=0\) | 2 | 0 |
| \(x=1\) | 2 | 2 |
Use the logistic model \(P(Y_i=1\mid x_i)=p_i\), with \(\operatorname{logit}(p_i)=\beta_0+\beta_1x_i\). Write \(\eta_0=\beta_0\) for the linear predictor at \(x=0\), and \(\eta_1=\beta_0+\beta_1\) for the linear predictor at \(x=1\). These two group logits are also convenient coordinates for the calculations: \(\beta_0=\eta_0\) and \(\beta_1=\eta_1-\eta_0\).
Ordinary Likelihood: The Supremum Is Not Attained
For this dataset the likelihood, expressed in terms of the group probabilities, is \(L=(1-p_0)^2p_1^2\), where \(p_j=\operatorname{logit}^{-1}(\eta_j)\). Each factor is at most one, so \(L\leq 1\). At any finite pair of logits, both probabilities lie strictly between zero and one, and therefore \(L<1\).
Worked Example: Following the Ordinary Likelihood Toward Its Supremum
Choose \(\beta_0=-t\) and \(\beta_1=2t\), where \(t>0\). Then \(\eta_0=-t\) at \(x=0\), and \(\eta_1=t\) at \(x=1\). With \(\operatorname{logit}^{-1}(z)=e^z/(1+e^z)\),
As \(t\to\infty\), \(e^t/(1+e^t)\to 1\), so \(L(t)\to 1\). Since \(L<1\) for every finite coefficient pair, the likelihood has supremum 1 but no finite maximizer. Along this path \(\beta_0\to-\infty\) and \(\beta_1\to+\infty\); the fitted probabilities approach 0 for the failures and 1 for the successes. This explicit path demonstrates coefficient divergence without requiring a numerical optimizer to report very large estimates.
The path is a witness to non-attainment: it shows that likelihood values can get arbitrarily close to 1. The upper bound \(L\leq1\) shows that they cannot exceed 1. Together, these facts establish the supremum. The group formulation also makes clear why merely stopping an ordinary fitting algorithm at a large coefficient does not produce a finite maximum-likelihood estimate.
Firth’s Adjustment and the Exact Fit
For a logistic model, Firth’s method maximizes the Jeffreys-penalized log-likelihood \(\ell^*(\beta)=\ell(\beta)+\tfrac12\log|I(\beta)|\), where \(I(\beta)=X^\mathsf{T}WX\) is the expected information, \(X\) is the design matrix, and \(W\) has diagonal entries \(p_i(1-p_i)\). Here \(|I|\) denotes the determinant. In the group-logit coordinates, the information is diagonal, with entries \(2p_0(1-p_0)\) and \(2p_1(1-p_1)\). The coordinate transformation from \((\beta_0,\beta_1)\) to \((\eta_0,\eta_1)\) has determinant 1, so it leaves this determinant unchanged.
Here \(y_0=0\) and \(y_1=2\). The likelihood and the penalty separate by group, apart from the constant \(\tfrac12\log4\). Differentiating the contribution from group \(j\) with respect to \(\eta_j\), using \(dp_j/d\eta_j=w_j\), gives the adjusted score \(y_j+\tfrac12-3p_j\).
Proof. The group log-likelihood, omitting a constant that does not depend on \(\eta\), is \(y\eta-n\log(1+e^\eta)\). Its information is \(nw\), where \(w=p(1-p)\), so the group’s Jeffreys penalty is \(\tfrac12\log(nw)\). The derivative of the log-likelihood is \(y-np\). Also, \(d\log(w)/d\eta=1-2p\), since \(dp/d\eta=w\) and \(d\log(p(1-p))/dp=1/p-1/(1-p)\). The derivative of the penalty is consequently \(\tfrac12(1-2p)=\tfrac12-p\). Adding the derivatives gives \(y+\tfrac12-(n+1)p\). Setting this equal to zero gives the stated probability. Because \(0\leq y\leq n\), \(0<y+\tfrac12<n+1\), so the probability is interior. Finally, the derivative of the adjusted score with respect to \(\eta\) is \(-(n+1)p(1-p)<0\) at every finite \(\eta\). Thus the score is strictly decreasing and its zero is unique; the penalized group objective increases before that zero and decreases after it. \(\square\)
Worked Example: Calculating the Firth Estimates
Apply the result with \(n=2\) in each group. For \(x=0\), \(y_0=0\), so \(p_0=(0+\tfrac12)/3=1/6\). For \(x=1\), \(y_1=2\), so \(p_1=(2+\tfrac12)/3=5/6\). Both adjusted scores are zero:
The group logits are \(\eta_0=\log((1/6)/(5/6))=-\log 5\) and \(\eta_1=\log((5/6)/(1/6))=\log 5\). Therefore \(\beta_0=-\log5\) and \(\beta_1=\eta_1-\eta_0=2\log5\). The coefficients are finite, and the fitted probabilities are \(1/6\) and \(5/6\), not zero and one.
As a numerical check on the penalty, the ordinary likelihood evaluated at these estimates is \((5/6)^4=625/1296\). Each group has \(w_j=(1/6)(5/6)=5/36\), so \(|I|=4(5/36)^2=25/324\) and \(\sqrt{|I|}=5/18\). Thus the Jeffreys-penalized likelihood \(L^*=L\sqrt{|I|}\) at this fit is
The last decimal is rounded to four places. The numerical value of a penalized likelihood depends on its scale and is not itself a probability; here it simply checks the likelihood and determinant calculations.
Tracing the Adjusted-Score Updates
The adjusted-score equations can also be followed through Fisher-scoring updates. In individual-observation notation, the logistic adjusted score is \(U^*(\beta)=X^\mathsf{T}\{y-p+h\mathbin{\odot}(\tfrac12-p)\}\), where \(h_i\) is the \(i\)th diagonal element of \(H=W^{1/2}X(X^\mathsf{T}WX)^{-1}X^\mathsf{T}W^{1/2}\), and \(\odot\) means elementwise multiplication. For this two-group design, each observation in a group has leverage \(1/2\): the two observations with the same predictor value share the one fitted group direction. Summing their adjusted residuals gives the group score \(y_j+\tfrac12-3p_j\), as derived above.
Worked Example: The First Fisher-Scoring Updates
Start at \(\eta_0=\eta_1=0\), equivalent to \((\beta_0,\beta_1)=(0,0)\). Both group probabilities are \(1/2\), with \(w_j=1/4\). The adjusted group scores are \(-1\) and \(1\). The information for each group logit is \(2w_j=1/2\), so the Fisher-scoring increments are the scores divided by \(1/2\):
After one update, \((\eta_0,\eta_1)=(-2,2)\), which corresponds to \((\beta_0,\beta_1)=(-2,4)\). At this point \(p_0=\operatorname{logit}^{-1}(-2)\approx0.119203\), \(p_1\approx0.880797\), and \(w_0=w_1\approx0.104994\). The adjusted scores are approximately \(0.142391\) and \(-0.142391\); the information for either group logit is \(2w_j\approx0.209987\). The next increments are therefore approximately \(0.678095\) and \(-0.678095\), giving \((\eta_0,\eta_1)\approx(-1.321905,1.321905)\). The updates move both logits toward their finite targets, \((-\log5,\log5)\).
At the exact target, both adjusted scores vanish, and the information remains positive because both fitted probabilities are interior. This checks the equations directly: Firth’s fit is a finite stationary point, not an arbitrarily truncated step along the ordinary-likelihood divergence path.
The finite solution follows from the score equations rather than from a claim that an algorithm must converge from every possible starting value. The calculations above show specific updates from the zero start and verify the exact endpoint by substitution. In this saturated two-group example, the adjusted objective separates into two strictly concave group contributions, each with its unique finite maximum at the probability given in the theorem. Together they establish the unique finite maximum for this example.
Why the Example Matters
This dataset isolates the mechanism of the correction. Ordinary likelihood rewards making the observed failures’ probabilities approach zero and the observed successes’ probabilities approach one. Under separation, it can keep increasing in that direction without attaining a finite maximum. The Jeffreys penalty changes the score by a leverage-weighted adjustment; here its group totals add one-half success to each group and increase the probability multiplier from \(n\) to \(n+1\). That adjustment prevents either fitted group probability from reaching a boundary.
The fitted values are not the observed proportions: those proportions are 0 and 1, while the Firth values are \(1/6\) and \(5/6\). This difference is the point of the example. It does not imply that every separated dataset has these particular estimates; the calculation depends on this design and these group sizes.
- Common mistake: “The optimizer returned a very large slope, so that must be the maximum-likelihood estimate.” A large finite output can instead be an algorithmic stopping point while the likelihood is still increasing.
- Correction: Check whether a finite maximizer exists. Here every finite fit has \(L<1\), while the explicit diverging path has \(L(t)\to1\), so no finite ordinary maximum-likelihood estimate exists.
- Common mistake: “Firth correction just replaces each observed group proportion by a value halfway toward one-half.” That shortcut does not explain the fitted coefficients or the role of the information penalty.
- Correction: Derive the adjusted score, solve its zero, and then transform the group logits back to the model coefficients. In this example that calculation gives \(1/6\), \(5/6\), \(-\log5\), and \(2\log5\).
Check Your Understanding
Use the two-group dataset and calculations above to answer the following questions.
- Why does the ordinary likelihood have supremum 1 but no finite maximizer in this example?
- Along the path \(\beta_0=-t,\ \beta_1=2t\), what are the two group logits, and what happens to the likelihood as \(t\to\infty\)?
- Write the Firth-adjusted score for a group with \(n=2\) and \(y\) successes. What probability makes it zero?
- Convert the Firth group logits \((-\log5,\log5)\) to the intercept and slope.
- At the initial fit \(\eta_0=\eta_1=0\), what are the adjusted scores and Fisher-scoring increments?