Tutorials › Generalized Linear Models › Curvature Of The Poisson Regression Log-Likelihood

Poisson Regression Foundations · Tutorial 423 of 981

Curvature Of The Poisson Regression Log-Likelihood

Derive the Hessian of the Poisson regression log-likelihood and connect its curvature, strictness, and flat directions to the design matrix.

Intermediate 10 min read

What You'll Learn

  • Derive the Poisson regression Hessian from the log-likelihood and score
  • Identify the diagonal weight matrix formed by fitted conditional means
  • Prove that the Hessian is negative semidefinite at every finite coefficient vector
  • State the design-matrix rank condition for strict concavity
  • Interpret zero-curvature directions and distinguish them from negative curvature
  • Calculate Hessians and directional curvature in concrete Poisson models

Why Curvature Matters

The score in Poisson regression describes the local change in log-likelihood as the coefficients move. The Hessian describes how that change itself varies: it records the log-likelihood's curvature in every coefficient direction. This matters for understanding the shape of the objective, for determining whether a direction has genuine curvature or is flat, and for numerical optimization.

For Poisson regression with a log link, the curvature has a particularly useful form: a negative weighted cross-product of the design matrix. The weights are the fitted conditional means, so they are positive at every finite coefficient vector. That positivity is the key to proving concavity and identifying exactly when the curvature is strict.

Log-Likelihood and Hessian

Suppose \(Y_1,\ldots,Y_n\) are independent responses with \(Y_i\sim\operatorname{Poisson}(\mu_i)\), where the fixed design row for observation \(i\) is \(\mathbf{x}_i^\top\), a vector of \(p\) covariates including any intercept. The log-link model is \(\log(\mu_i)=\mathbf{x}_i^\top\boldsymbol{\beta}\), with coefficient vector \(\boldsymbol{\beta}\in\mathbb{R}^p\). Thus \(\mu_i(\boldsymbol{\beta})=\exp(\mathbf{x}_i^\top\boldsymbol{\beta})\), which is positive and finite for every finite \(\boldsymbol{\beta}\).

Let \(\mathbf{X}\) be the \(n\times p\) design matrix with rows \(\mathbf{x}_i^\top\), and let \(\mathbf{y}\) contain the observed counts \(y_i\). For nonnegative integer observations, the log-likelihood, up to no omitted parameter-dependent terms, is

$$ \ell(\boldsymbol{\beta}) = \sum_{i=1}^n \left[ y_i\mathbf{x}_i^\top\boldsymbol{\beta} -\exp(\mathbf{x}_i^\top\boldsymbol{\beta}) -\log(y_i!) \right]. $$

The factorial term does not depend on \(\boldsymbol{\beta}\). Differentiating the remaining terms gives the score \(\nabla\ell(\boldsymbol{\beta})=\sum_i\mathbf{x}_i(y_i-\mu_i(\boldsymbol{\beta}))\). To differentiate again, use \(\nabla\mu_i(\boldsymbol{\beta})=\mu_i(\boldsymbol{\beta})\mathbf{x}_i\). This yields the Hessian.

Definition: For a coefficient vector \(\boldsymbol{\beta}\), define \(W(\boldsymbol{\beta})\) to be the \(n\times n\) diagonal matrix whose \(i\)th diagonal entry is the fitted conditional mean \(\mu_i(\boldsymbol{\beta})=\exp(\mathbf{x}_i^\top\boldsymbol{\beta})\). The Poisson regression log-likelihood Hessian is \(\nabla^2\ell(\boldsymbol{\beta})=-\mathbf{X}^\top W(\boldsymbol{\beta})\mathbf{X}\).
$$ \nabla^2\ell(\boldsymbol{\beta}) = -\sum_{i=1}^n \mu_i(\boldsymbol{\beta})\mathbf{x}_i\mathbf{x}_i^\top = -\mathbf{X}^\top W(\boldsymbol{\beta})\mathbf{X}. $$

Each term \(\mathbf{x}_i\mathbf{x}_i^\top\) is a \(p\times p\) matrix, and each weight \(\mu_i(\boldsymbol{\beta})\) is positive. The observed counts do not appear directly in the Hessian. They affect the score, but at a fixed coefficient vector the curvature is determined by the design and the model-implied means.

Concavity and the Rank Condition

Theorem: Under the independent Poisson log-link model above, \(\ell\) is concave on \(\mathbb{R}^p\). At every finite \(\boldsymbol{\beta}\), its Hessian is negative definite if and only if \(\mathbf{X}\) has full column rank \(p\). Consequently, the log-likelihood is strictly concave on \(\mathbb{R}^p\) exactly when \(\mathbf{X}\) has full column rank.

Proof. Let \(\mathbf{a}\in\mathbb{R}^p\) be any direction. By the Hessian expression, its quadratic form is

$$ \mathbf{a}^\top\nabla^2\ell(\boldsymbol{\beta})\mathbf{a} = -\mathbf{a}^\top\mathbf{X}^\top W(\boldsymbol{\beta})\mathbf{X}\mathbf{a} = -\sum_{i=1}^n\mu_i(\boldsymbol{\beta})(\mathbf{x}_i^\top\mathbf{a})^2 \leq 0. $$

The inequality follows because every \(\mu_i(\boldsymbol{\beta})>0\) and every squared term is nonnegative. Therefore the Hessian is negative semidefinite. To show that this implies concavity here, take any two coefficient vectors \(\boldsymbol{\beta}_0,\boldsymbol{\beta}_1\) and define \(g(t)=\ell(\boldsymbol{\beta}_0+t(\boldsymbol{\beta}_1-\boldsymbol{\beta}_0))\) for \(0\leq t\leq1\). The second derivative is the Hessian quadratic form in direction \(\boldsymbol{\beta}_1-\boldsymbol{\beta}_0\), so \(g''(t)\leq0\). A twice differentiable function on an interval with nonpositive second derivative is concave; hence \(\ell\) is concave on \(\mathbb{R}^p\).

For strict negativity, the displayed quadratic form equals zero precisely when \(\mathbf{x}_i^\top\mathbf{a}=0\) for every \(i\), because all weights are strictly positive. This is equivalent to \(\mathbf{X}\mathbf{a}=\mathbf{0}\). Thus the Hessian is negative definite exactly when the only vector in the null space of \(\mathbf{X}\) is \(\mathbf{0}\), which is exactly full column rank. If \(\mathbf{X}\) has full column rank, then for any two distinct coefficient vectors the direction between them is nonzero and has strictly negative second derivative along the entire joining line. Therefore the log-likelihood is strictly concave. If \(\mathbf{X}\) is rank deficient, choose a nonzero \(\mathbf{a}\) with \(\mathbf{X}\mathbf{a}=\mathbf{0}\). Then \(\mathbf{X}(\boldsymbol{\beta}+t\mathbf{a})=\mathbf{X}\boldsymbol{\beta}\) for every real \(t\); all linear predictors and the log-likelihood remain unchanged along that line. Strict concavity fails. \(\square\)

Worked Curvature Calculations

Worked Example: A Two-Coefficient Model

Consider three observations with design rows \((1,0)\), \((1,1)\), and \((1,2)\), and observed counts \(y=(1,3,7)\). Evaluate the Hessian at \(\boldsymbol{\beta}=(\log 2,\log 2)^\top\). The linear predictors are \(\log 2\), \(\log 4\), and \(\log 8\), so the fitted means are \(2,4,8\). Thus \(W=\operatorname{diag}(2,4,8)\).

The weighted cross-product can be calculated term by term. The diagonal entry for the intercept is \(2+4+8=14\). The off-diagonal entry is \(2(0)+4(1)+8(2)=20\). The slope diagonal entry is \(2(0^2)+4(1^2)+8(2^2)=36\). Therefore

$$ \nabla^2\ell(\boldsymbol{\beta}) = -\begin{pmatrix}14&20\\20&36\end{pmatrix}. $$

For a direction \(\mathbf{a}=(a_0,a_1)^\top\), the curvature is \(-2a_0^2-4(a_0+a_1)^2-8(a_0+2a_1)^2\), which is strictly negative for every nonzero direction because the three design rows span two dimensions. Equivalently, the matrix inside the minus sign has positive leading entry \(14\) and determinant \(14(36)-20^2=104>0\), so it is positive definite. The observed counts do not enter this Hessian calculation.

Worked Example: A Flat Direction From Duplicate Columns

Suppose there are three observations, each with design row \((1,1)\), and counts \(0,2,1\). The two columns of \(\mathbf{X}\) are identical. At \(\boldsymbol{\beta}=(0,0)^\top\), each fitted mean is \(1\), so \(W\) is the \(3\times3\) identity matrix. The Hessian is

$$ -\mathbf{X}^\top W\mathbf{X} = -\begin{pmatrix}3&3\\3&3\end{pmatrix}. $$

For direction \(\mathbf{a}=(1,-1)^\top\), the curvature is zero: \(\mathbf{X}\mathbf{a}=\mathbf{0}\), so the weighted quadratic form vanishes. More directly, every linear predictor equals \(\beta_1+\beta_2\). Moving from \((0,0)\) to \((t,-t)\) leaves each fitted mean equal to \(1\), and leaves the log-likelihood unchanged. For these data the log-likelihood along that line is \(3(0)-3-\log(0!)-\log(2!)-\log(1!)=-3-\log 2\), for every real \(t\). The Hessian is negative semidefinite but not negative definite, and the log-likelihood is not strictly concave.

Worked Example: Intercept-Only Curvature at a Stationary Point

Take two independent counts \(y_1=1\) and \(y_2=3\), with an intercept-only model. Both design entries are \(1\), and the common fitted mean is \(\mu(\beta)=\exp(\beta)\). At \(\beta=\log 2\), each fitted mean is \(2\), so \(W=\operatorname{diag}(2,2)\). The scalar Hessian is

$$ \frac{d^2\ell}{d\beta^2} = -\begin{pmatrix}1&1\end{pmatrix} \begin{pmatrix}2&0\\0&2\end{pmatrix} \begin{pmatrix}1\\1\end{pmatrix} =-(2+2)=-4. $$

The score at this same coefficient is \(y_1+y_2-2-2=1+3-4=0\), while the second derivative is \(-4\). The design matrix has one nonzero column, hence full column rank, and the curvature is strictly negative. This example separates two local quantities: the score is zero at the stated coefficient, while the negative Hessian describes how the log-likelihood bends there.

Interpreting Strict and Non-Strict Curvature

The quadratic form offers a practical interpretation. A direction \(\mathbf{a}\) changes the linear predictor for observation \(i\) by \(\mathbf{x}_i^\top\mathbf{a}\). The curvature in that direction is the negative sum of the squared predictor changes, weighted by the fitted means. A direction that changes at least one predictor has strictly negative curvature; a direction changing none of them has zero curvature.

The weights also explain why the Hessian depends on the current coefficient vector: changing \(\boldsymbol{\beta}\) changes the fitted means and therefore changes how strongly each observation contributes to curvature. But for every finite coefficient vector, each weight remains positive, so this change cannot reverse the sign of curvature. This is why concavity is global, not merely a property at one candidate estimate.

Common Pitfall

  • Wrong reasoning: “The Hessian is negative definite because the fitted means are positive.” Positivity of the means makes the weighted cross-product nonnegative in every direction, but it does not guarantee that every nonzero coefficient direction changes a predictor.
  • Correction: Positive weights guarantee a negative semidefinite Hessian. Negative definiteness additionally requires \(\mathbf{X}\mathbf{a}\ne\mathbf{0}\) for every nonzero \(\mathbf{a}\), or equivalently full column rank. Duplicate or linearly dependent design columns create flat directions.
  • Another common error: putting the observed counts \(y_i\) on the Hessian diagonal. The counts occur in the score, but differentiating the score replaces the fitted means with the weights in the Hessian.
Key takeaway: In Poisson regression with a log link, the Hessian is \(-\mathbf{X}^\top W(\boldsymbol{\beta})\mathbf{X}\), with strictly positive fitted-mean weights. It is always negative semidefinite; it is negative definite, and the log-likelihood strictly concave, exactly when the design matrix has full column rank.

Check Your Understanding

Use the Hessian formula and rank condition to answer the following.

  1. Why do observed counts appear in the score but not in the Poisson regression Hessian?
  2. For a direction \(\mathbf{a}\), write the Hessian quadratic form as a sum over observations and state when it equals zero.
  3. What rank condition on an \(n\times p\) design matrix makes the Hessian negative definite at every finite coefficient vector?
  4. If two columns of the design matrix are identical, identify a coefficient direction that leaves every linear predictor unchanged.
  5. Can a Poisson regression Hessian be positive definite under the log link? Explain using its quadratic form.
Clinical Biostats