Tutorials › Generalized Linear Models › Logistic Information and Likelihood Curvature

Binary Logistic Regression · Tutorial 349 of 981

Logistic Information and Likelihood Curvature

Learn how logistic likelihood curvature determines information about coefficients and how to compute the resulting covariance approximation.

Intermediate 11 min read

What You'll Learn

  • Derive the logistic score vector and log-likelihood Hessian
  • Show why observed and expected Fisher information coincide in this model
  • Determine when the log-likelihood is concave or strictly concave
  • Use local likelihood curvature to obtain a coefficient covariance approximation
  • Calculate an information matrix and its inverse for explicit design matrices
  • Recognize rank deficiency and weak information as limits on inference

Why Likelihood Curvature Matters

In binary logistic regression, the likelihood records how well a coefficient vector agrees with the observed outcomes. Its slope indicates a direction in which the likelihood increases; its curvature describes how quickly that increase slows near a maximum. That curvature provides a direct measure of how much information the data contain about the coefficients and, under suitable conditions, an approximation to their sampling uncertainty.

The key calculation is especially useful in logistic regression: the negative Hessian of the log-likelihood has the form of a weighted cross-product of the design matrix. Each weight depends on a fitted probability, and is largest when that probability is near one half. We derive this form, establish the concavity it implies, and work through numerical information matrices.

Score, Hessian, and Fisher Information

Suppose \(Y_1,\ldots,Y_n\) are independent Bernoulli responses, with fixed predictor vectors \(\mathbf{x}_i\in\mathbb{R}^q\). Write the coefficient vector as \(\boldsymbol{\beta}\), the linear predictor as \(\eta_i=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}\), and the success probability as \(p_i=\{1+\exp(-\eta_i)\}^{-1}\). Let \(X\) be the \(n\) by \(q\) matrix whose \(i\)th row is \(\mathbf{x}_i^\mathsf{T}\). The log-likelihood for the observed values \(y_i\in\{0,1\}\), omitting no terms that depend on the coefficients, is

$$ \ell(\boldsymbol{\beta}) =\sum_{i=1}^n\left\{y_i\eta_i-\log(1+\exp(\eta_i))\right\}. $$

Differentiating with respect to \(\boldsymbol{\beta}\) gives the score vector. Differentiating again gives the Hessian matrix, the matrix of second partial derivatives.

Definition: The observed information at \(\boldsymbol{\beta}\) is the negative Hessian, \(-\nabla^2\ell(\boldsymbol{\beta})\). The Fisher information is the expected observed information, with expectation taken under the model at \(\boldsymbol{\beta}\). For logistic regression, both are \(X^\mathsf{T}WX\), where \(W\) is diagonal with entries \(p_i(1-p_i)\).
Result: For independent Bernoulli responses with the logistic model above,
$$ \nabla\ell(\boldsymbol{\beta})=X^\mathsf{T}(\mathbf{y}-\mathbf{p}), \qquad \nabla^2\ell(\boldsymbol{\beta})=-X^\mathsf{T}WX, \qquad \mathcal{I}(\boldsymbol{\beta})=X^\mathsf{T}WX, $$
where \(\mathbf{y}=(y_1,\ldots,y_n)^\mathsf{T}\), \(\mathbf{p}=(p_1,\ldots,p_n)^\mathsf{T}\), and \(\mathcal{I}\) denotes Fisher information.

To derive the result, first note that \(d p_i/d\eta_i=p_i(1-p_i)\). The derivative of a single log-likelihood contribution with respect to \(\eta_i\) is \(y_i-p_i\). Since \(d\eta_i/d\boldsymbol{\beta}=\mathbf{x}_i\), summing the individual gradients gives

$$ \nabla\ell(\boldsymbol{\beta}) =\sum_{i=1}^n \mathbf{x}_i(y_i-p_i) =X^\mathsf{T}(\mathbf{y}-\mathbf{p}). $$

Differentiating this score once more, the derivative of \(p_i\) with respect to \(\boldsymbol{\beta}\) is \(p_i(1-p_i)\mathbf{x}_i\). Therefore

$$ \nabla^2\ell(\boldsymbol{\beta}) =-\sum_{i=1}^n p_i(1-p_i)\mathbf{x}_i\mathbf{x}_i^\mathsf{T} =-X^\mathsf{T}WX. $$

This Hessian does not depend on the observed \(y_i\) once \(\boldsymbol{\beta}\) is fixed. Consequently its negative equals its own expectation, giving \(\mathcal{I}(\boldsymbol{\beta})=X^\mathsf{T}WX\). The same expression also follows from the covariance of the score: the responses are independent, \(E[Y_i]=p_i\), and \(\operatorname{Var}(Y_i)=p_i(1-p_i)\), so

$$ \operatorname{Var}\{\nabla\ell(\boldsymbol{\beta})\} =\sum_{i=1}^n \operatorname{Var}(Y_i)\mathbf{x}_i\mathbf{x}_i^\mathsf{T} =X^\mathsf{T}WX. $$

Thus, in this model, observed information and expected information coincide at every finite coefficient vector. This equality is a property of the logistic likelihood; it does not mean information is constant as the coefficients change, because the \(p_i\), and hence the diagonal entries of \(W\), change with \(\boldsymbol{\beta}\).

Worked Example: Curvature From One Observation

Take one Bernoulli observation with \(y_1=1\) and predictor vector \(\mathbf{x}_1=(1,1)^\mathsf{T}\). Evaluate the score and Hessian at \(\boldsymbol{\beta}=(0,0)^\mathsf{T}\).

The linear predictor is \(\eta_1=1(0)+1(0)=0\), so \(p_1=1/(1+\exp(0))=1/2\) and \(p_1(1-p_1)=1/4\). The score is

$$ \mathbf{x}_1(y_1-p_1) = \begin{pmatrix}1\\1\end{pmatrix}\left(1-\frac12\right) = \begin{pmatrix}1/2\\1/2\end{pmatrix}. $$

The Hessian is the negative weighted outer product:

$$ -\frac14\mathbf{x}_1\mathbf{x}_1^\mathsf{T} =-\frac14 \begin{pmatrix}1&1\\1&1\end{pmatrix} = \begin{pmatrix}-1/4&-1/4\\-1/4&-1/4\end{pmatrix}. $$

This matrix has rank one: this single observation supplies curvature in the direction \((1,1)^\mathsf{T}\), but cannot distinguish changes to the two coefficients that leave their sum unchanged.

Concavity and What It Does Not Guarantee

The information matrix is positive semidefinite. For any vector \(\mathbf{v}\in\mathbb{R}^q\),

$$ \mathbf{v}^\mathsf{T}X^\mathsf{T}WX\mathbf{v} =\sum_{i=1}^n p_i(1-p_i)(\mathbf{x}_i^\mathsf{T}\mathbf{v})^2 \geq 0. $$

Because the Hessian is the negative of this matrix, the log-likelihood is concave over the coefficient space. For finite coefficients and finite predictor values, every \(p_i(1-p_i)\) is strictly positive. The Hessian is then negative definite at every coefficient vector precisely when \(X\) has full column rank. If \(X\) is rank deficient, there is a nonzero vector \(\mathbf{v}\) with \(X\mathbf{v}=0\); moving the coefficients along that direction does not change any linear predictor or the likelihood.

Result: The logistic log-likelihood is concave for all coefficient vectors. If \(X\) has full column rank, it is strictly concave, so there can be at most one finite maximizer. Concavity alone does not guarantee that a finite maximizer exists.

The rank condition gives a statement about curvature, not a guarantee that the data yield a finite maximum. For example, in a separable data set, coefficients can move farther in a direction that improves the likelihood while the fitted probabilities approach zero or one. The likelihood can approach its supremum without attaining it at any finite coefficient vector. In that situation, strict concavity at finite coefficient vectors does not produce a finite maximum.

Worked Example: Information for a Three-Row Design

Consider the design matrix with rows \((1,0)\), \((1,1)\), and \((1,2)\), and evaluate information at \(\boldsymbol{\beta}=(0,0)^\mathsf{T}\). All three linear predictors are zero, so all three probabilities are \(1/2\), and all weights are \(1/4\).

The cross-product of the design matrix is

$$ X^\mathsf{T}X = \begin{pmatrix} 3&3\\ 3&5 \end{pmatrix}, \qquad \mathcal{I}(\boldsymbol{\beta}) =\frac14X^\mathsf{T}X = \begin{pmatrix} 3/4&3/4\\ 3/4&5/4 \end{pmatrix}. $$

For illustration, let the observed outcomes be \((0,1,1)^\mathsf{T}\). The score at this coefficient vector is

$$ X^\mathsf{T}(\mathbf{y}-\mathbf{p}) = \begin{pmatrix} 1&1&1\\ 0&1&2 \end{pmatrix} \begin{pmatrix}-1/2\\1/2\\1/2\end{pmatrix} = \begin{pmatrix}1/2\\3/2\end{pmatrix}. $$

The information determinant is \((3/4)(5/4)-(3/4)^2=6/16=3/8\), so the matrix is invertible. Its inverse is

$$ \mathcal{I}(\boldsymbol{\beta})^{-1} = \frac{1}{3/8} \begin{pmatrix}5/4&-3/4\\-3/4&3/4\end{pmatrix} = \begin{pmatrix}10/3&-2\\-2&2\end{pmatrix}. $$

If these coefficients were the fitted coefficients, this inverse would be the local covariance approximation. Here the calculation is specifically at \((0,0)^\mathsf{T}\); the observed score is not zero there, so this is not a covariance estimate evaluated at a fitted maximum.

From Information to a Covariance Approximation

Near a finite maximum-likelihood estimate \(\hat{\boldsymbol{\beta}}\), the score is zero. A second-order Taylor expansion of the log-likelihood around that estimate gives, for a nearby coefficient vector \(\boldsymbol{\beta}\),

$$ \ell(\boldsymbol{\beta}) \approx \ell(\hat{\boldsymbol{\beta}}) -\frac12(\boldsymbol{\beta}-\hat{\boldsymbol{\beta}})^\mathsf{T} \mathcal{I}(\hat{\boldsymbol{\beta}}) (\boldsymbol{\beta}-\hat{\boldsymbol{\beta}}). $$

The quadratic term describes the local curvature. A direction with large curvature is one in which a small coefficient change lowers the log-likelihood sharply; a direction with little curvature allows more variation without a comparable likelihood decrease. When the model is correctly specified and standard large-sample maximum-likelihood conditions hold, including a finite true coefficient vector, fixed dimension, full-rank design, and increasing information, this local quadratic approximation motivates the familiar covariance approximation

$$ \widehat{\operatorname{Cov}}(\hat{\boldsymbol{\beta}}) \approx \mathcal{I}(\hat{\boldsymbol{\beta}})^{-1} = \left\{X^\mathsf{T}\hat{W}X\right\}^{-1}, \qquad \hat{W}_{ii}=\hat{p}_i(1-\hat{p}_i). $$

The approximation is not an exact finite-sample covariance identity. It uses curvature at the fitted coefficients as a measure of sampling uncertainty. It also requires an invertible information matrix. If the design is rank deficient, the inverse does not exist; if some fitted probabilities are very close to zero or one, their weights are small and the information may be weak in relevant directions.

Worked Example: How Fitted Probabilities Affect Information

Use two predictor vectors, \((1,0)^\mathsf{T}\) and \((1,1)^\mathsf{T}\), and evaluate information at \(\boldsymbol{\beta}=(0,\log 3)^\mathsf{T}\). The corresponding linear predictors are \(0\) and \(\log 3\), so the probabilities are \(1/2\) and \(3/4\). Their weights are \(1/4\) and \((3/4)(1/4)=3/16\).

The information matrix is the sum of the two weighted outer products:

$$ \mathcal{I}(\boldsymbol{\beta}) =\frac14 \begin{pmatrix}1&0\\0&0\end{pmatrix} +\frac{3}{16} \begin{pmatrix}1&1\\1&1\end{pmatrix} = \begin{pmatrix}7/16&3/16\\3/16&3/16\end{pmatrix}. $$

Its determinant is \((21-9)/256=3/64\), and therefore

$$ \mathcal{I}(\boldsymbol{\beta})^{-1} = \frac{64}{3} \begin{pmatrix}3/16&-3/16\\-3/16&7/16\end{pmatrix} = \begin{pmatrix}4&-4\\-4&28/3\end{pmatrix}. $$

The second observation has probability \(3/4\), so its weight \(3/16\) is smaller than the maximum possible weight \(1/4\), attained at probability \(1/2\). Its contribution to information is correspondingly reduced. The inverse is again a local covariance approximation at the stated coefficient vector; for a fitted covariance approximation, the probabilities must be evaluated at the fitted coefficients.

Common Mistake: Treating Inverse Information as Exact

A tempting but incorrect argument is: “The inverse Hessian is the covariance matrix, so it is exact whenever the Hessian can be inverted.” The Hessian describes curvature of the observed log-likelihood at a particular coefficient vector; it does not by itself equal the finite-sample sampling covariance of the estimator. The correction is to call its inverse a local or large-sample covariance approximation, and to check that the fitted information is invertible and the model’s regularity conditions are plausible. A highly curved likelihood may still be a poor normal approximation in a small or unusual sample.

Key takeaway: Logistic information is \(X^\mathsf{T}WX\), with weights \(p_i(1-p_i)\). It determines local curvature and yields an inverse-information covariance approximation when it is nonsingular and large-sample conditions are appropriate.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. Why does the logistic score have the form \(X^\mathsf{T}(\mathbf{y}-\mathbf{p})\)?
  2. What condition on the design matrix makes the Hessian negative definite at finite coefficient vectors?
  3. For which probability \(p\) is the Bernoulli information weight \(p(1-p)\) largest, and what is that maximum?
  4. Why can a concave logistic log-likelihood fail to have a finite maximizer?
  5. Why should the inverse information matrix be described as a covariance approximation rather than an exact covariance?
Clinical Biostats