Why the Score and Hessian Matter
Maximum likelihood is an optimization problem: for the observed data, choose parameter values that make the observations most likely under the model. The likelihood can be difficult to optimize directly, but its log has the same maximizers and often has simpler derivatives. Its gradient, called the score vector, identifies stationary points; its Hessian describes local curvature. Together they provide necessary conditions for an interior maximum and, under an additional curvature condition, a sufficient condition for a strict local maximum.
These conditions do not turn every solution of the score equations into a maximum. A stationary point could instead be a minimum or a saddle point. The distinction is important both in analytic derivations and when interpreting the output of a numerical optimizer.
Definitions and First-Order Conditions
Let \(Y_1,\ldots,Y_n\) denote independent observations with likelihood contributions \(f_i(y_i;\theta)\), where \(\theta=(\theta_1,\ldots,\theta_k)^\top\) is a \(k\)-dimensional parameter in a parameter space \(\Theta\). For the observed values \(y_1,\ldots,y_n\), write the likelihood as \(L_n(\theta)\) and the log-likelihood as \(\ell_n(\theta)=\log L_n(\theta)\), wherever the likelihood is positive. Independence gives a product likelihood and an additive log-likelihood.
Because the observations are independent, the log-likelihood is a sum. When the derivatives exist, its score and Hessian are sums of observation-specific contributions:
An interior point is a point inside the parameter space, rather than one on its boundary. If \(\ell_n\) is differentiable at an interior local maximum \(\hat\theta\), then each small change in any coordinate must have zero first derivative there. Thus \(s_n(\hat\theta)=0\). This is a necessary first-order condition, not a guarantee that a root exists, is unique, or maximizes the likelihood. At a boundary point, the unconstrained equation need not hold.
When \(L_n(\theta)>0\), the likelihood and log-likelihood have the same stationary points: differentiating \(L_n=\exp(\ell_n)\) gives \(\nabla_\theta L_n=L_n\nabla_\theta\ell_n\). Since \(L_n\) is positive, its gradient is zero exactly when the score is zero. The log scale is usually more convenient because it turns products into sums.
Worked Likelihood Derivations
Worked Example: Bernoulli Success Probability
Suppose five independent hypothetical observations are \(y=(1,1,0,1,0)\), where \(1\) denotes success. Under a Bernoulli model, each observation has success probability \(p\), with \(0<p<1\). There are three successes and two failures, so
Differentiate with respect to \(p\). The score and Hessian (here a scalar second derivative) are
The interior score equation gives \(3/p=2/(1-p)\), hence \(3(1-p)=2p\), so \(p=3/5=0.6000\). At this point,
The score is zero and the second derivative is negative, so the point is a strict local maximum. In fact the Hessian is negative throughout \(0<p<1\), making the log-likelihood strictly concave on this interval; the score root is therefore the unique interior maximizer. The estimate is a success probability, so it has no physical units.
Worked Example: Normal Mean with Known Variance
Consider hypothetical observations \(x_1=2\), \(x_2=4\), and \(x_3=5\) from independent normal distributions with unknown common mean \(\mu\) and known variance \(\sigma^2=4\). The log-likelihood, omitting no terms that depend on \(\mu\), is
Differentiating gives \(s(\mu)=\sum_i(x_i-\mu)/4\) and \(H(\mu)=-3/4\). The score equation is
At this candidate, \(H(\hat\mu)=-3/4=-0.7500<0\). The log-likelihood is a quadratic function with negative curvature everywhere, so \(\hat\mu\) is its unique maximum. It is the estimated mean, measured in the same units as the observations (for example, if \(x_i\) were measured in hours, \(\hat\mu\) would be \(3.667\) hours).
In a model with several parameters, a score equation is a system of equations, one for each component of \(\theta\). The Hessian is then a matrix, and its curvature must be assessed in all directions, not by checking one diagonal entry alone.
Worked Example: Score and Hessian in Logistic Regression
Suppose a hypothetical binary response \(Y_i\) is modeled with success probability \(p_i\) satisfying \(\log(p_i/(1-p_i))=\alpha+\beta x_i\). There are three observations with \(x_i=0\), of which two are successes, and three with \(x_i=1\), of which one is a success. Let \(z_i=(1,x_i)^\top\) and \(\theta=(\alpha,\beta)^\top\). The independent Bernoulli log-likelihood is
For each observation, differentiation uses \(\partial p_i/\partial\theta=p_i(1-p_i)z_i\). The resulting score and Hessian are
The group with \(x=0\) has observed success proportion \(2/3\), and the group with \(x=1\) has proportion \(1/3\). Setting the fitted probabilities to these proportions gives
At this candidate, the intercept score is the total observed successes minus total fitted successes: \(3-[3(2/3)+3(1/3)]=0\). The slope score receives contributions only from the \(x=1\) observations, and is \(1-3(1/3)=0\). Thus both components of the score vanish.
For each group, \(p_i(1-p_i)=2/9\). The \(x=0\) observations contribute only to the intercept-intercept entry, while the \(x=1\) observations contribute to all entries. Therefore,
The matrix inside the minus sign is positive definite: its first leading principal minor is \(4/3>0\), and its determinant is \((4/3)(2/3)-(2/3)^2=4/9>0\). Hence \(H(\hat\theta)\) is negative definite. Together with the zero score, this establishes a strict local maximum. The intercept is a log-odds at \(x=0\), and the slope is the change in log-odds for a one-unit increase in \(x\); both are dimensionless when \(x\) is dimensionless.
What the Second-Order Condition Establishes
The sufficiency statement follows from a second-order Taylor expansion. For a small displacement \(h\),
The first term is zero because the candidate is stationary. Negative definiteness means there is a constant \(c>0\) such that \(h^\top H_n(\hat\theta)h\leq-c\|h\|^2\) for every \(h\). The remainder divided by \(\|h\|^2\) tends to zero as \(h\) tends to zero. For sufficiently small nonzero \(h\), its absolute value is less than \(c\|h\|^2/4\). Consequently,
Thus nearby distinct parameter values have lower log-likelihood, which is precisely a strict local maximum. Continuous second derivatives ensure the Taylor expansion and its remainder behave as stated locally. For a necessary condition, if the Hessian had a direction \(v\) with \(v^\top H_n(\hat\theta)v>0\), the log-likelihood would increase for sufficiently small displacements along that direction, contradicting a local maximum. This explains why the Hessian at an interior local maximum must be negative semidefinite.
Negative definiteness is sufficient, not necessary: a strict maximum can have a zero second derivative in some direction. Conversely, negative definiteness without a zero gradient says nothing by itself about a maximum at the candidate.
Common Mistake: Treating a Zero Score as Proof of a Maximum
A frequent error is to solve the score equations and declare every solution to be the maximum-likelihood estimate. The equations only identify stationary points. For example, the function \(f(x)=x^2\) has \(f'(0)=0\), but \(x=0\) is a minimum. Similarly, a likelihood’s stationary point could be a minimum or a saddle point. Check curvature, and in applications also distinguish a local maximum from the global maximizer by examining other candidates and the parameter space.
A related error is to claim that a negative-definite Hessian alone proves a maximum. For \(f(x)=x-x^2\), \(f''(0)=-2\), but \(f'(0)=1\), so \(x=0\) is not stationary and is not a local maximum. The sufficient condition requires both a zero gradient at the candidate and a negative-definite Hessian there, with the Hessian continuous in a neighborhood. Interior first-order conditions also should not be applied mechanically at parameter-space boundaries.
Check Your Understanding
Use the definitions and conditions above to answer the following.
- Why does independence make the sample score a sum of observation-specific score contributions?
- For an interior local maximum, what first-order condition must hold, and what does it fail to establish on its own?
- State the full sufficient condition involving the score and Hessian for a strict local maximum.
- In the logistic regression example, why is checking only the diagonal entries of the Hessian not enough to establish negative definiteness?
- What can be concluded if the score is zero and the Hessian is negative semidefinite but not negative definite?