Tutorials › Econometrics (Graduate) › Constrained Maximum Likelihood And Reparameterization

Nonlinear Likelihood Estimation · Tutorial 445 of 952

Constrained Maximum Likelihood And Reparameterization

Use reparameterization or KKT conditions to maximize a likelihood subject to constraints, and assess how active constraints affect estimates and inference.

Intermediate 11 min read

What You'll Learn

  • Define a feasible parameter space and distinguish equality from inequality constraints.
  • Reparameterize an equality-constrained problem while preserving all feasible values.
  • Apply KKT stationarity, feasibility, dual-feasibility, and complementary-slackness conditions.
  • Check whether a constrained solution is a maximum rather than merely a stationary point.
  • Explain how equality restrictions and active inequality constraints change estimation and inference.

Why Constrain a Likelihood?

Likelihood maximization is often presented as an optimization over all possible parameter values. In applications, however, theory or the definition of a model may require parameters to satisfy restrictions: probabilities must lie between zero and one, variances must be positive, or two parameters may be required to sum to a known total. An estimate that ignores a genuine restriction may be impossible to interpret or may not belong to the model being fitted.

A constraint can be built into the parameterization, or it can be handled directly as part of the optimization problem. The first approach can simplify computation, but it must represent the entire feasible set. The second approach makes the role of active restrictions explicit through the Karush–Kuhn–Tucker (KKT) conditions.

Definition: Let \(\ell(\theta)\) be the log-likelihood for a parameter vector \(\theta\). A constrained maximum-likelihood estimate is a value \(\hat{\theta}\) that maximizes \(\ell(\theta)\) over a feasible set \(\mathcal{C}\), rather than over the unrestricted parameter space. Equality restrictions have the form \(h(\theta)=0\); inequality restrictions can be written \(g_j(\theta)\geq 0\). A restriction is active at \(\hat{\theta}\) when it holds with equality there.

The likelihood and its regularity conditions still matter: the data must be represented by the specified likelihood, and the log-likelihood and constraint functions must be sufficiently differentiable for the derivatives used below to exist. KKT conditions are local optimization conditions; they do not by themselves guarantee a global maximum. When the log-likelihood is concave and the feasible set is convex, a point satisfying the KKT conditions is a global maximum. A numerical optimizer's convergence report is not a substitute for checking feasibility and optimality.

Equality Constraints Through Reparameterization

Suppose an equality restriction can be represented by \(\theta=r(\phi)\), where every allowed \(\phi\) maps to a feasible \(\theta\), and every feasible \(\theta\) of interest is represented. Then the constrained problem becomes an unconstrained problem in \(\phi\):

$$ \max_{\phi}\ \ell(r(\phi)). $$

The chain rule gives the transformed score. If \(J_r(\phi)\) is the Jacobian matrix of \(r\), then

$$ \nabla_{\phi}\ell(r(\phi)) = J_r(\phi)^\mathsf{T}\nabla_{\theta}\ell(\theta) \big|_{\theta=r(\phi)}. $$

A transformed optimum therefore requires the original score to have no component in a feasible direction. It need not be zero in every direction in the unrestricted parameter space: some directions are ruled out by the equality restriction. This is why simply solving the unrestricted score equations and checking the constraint afterward generally does not produce the constrained estimate.

Worked Example: Two Means With a Fixed Sum

Suppose two independent groups each have five observations from normal distributions with known variance \(1\), with respective means \(\mu_1\) and \(\mu_2\). The observed sample means are \(4\) and \(8\). Impose the restriction \(\mu_1+\mu_2=10\). Find the constrained maximum-likelihood estimates.

Model and objective. For independent normal observations with common known variance \(1\), the part of the log-likelihood that depends on the means is \(\ell(\mu_1,\mu_2)=-\tfrac12\sum_{j=1}^2\sum_{i=1}^5(x_{ij}-\mu_j)^2\). For fixed data, maximizing this expression is equivalent to minimizing the sum of squared deviations. Using the sample means, the part that depends on the estimates is therefore equivalent to minimizing \(5[(\mu_1-4)^2+(\mu_2-8)^2]\).

Reparameterize. Set \(\mu_2=10-\mu_1\). The constrained problem reduces to minimizing \(5[(\mu_1-4)^2+(\mu_1-2)^2]\), since \(\mu_2-8=2-\mu_1\). Differentiating with respect to \(\mu_1\) gives \(10[(\mu_1-4)+(\mu_1-2)]=20\mu_1-60\). Setting the derivative to zero yields \(\hat{\mu}_1=3\), and the restriction then gives \(\hat{\mu}_2=7\).

The solution is a maximum of the log-likelihood: the minimized sum of squares is strictly convex in \(\mu_1\), so its unique minimum is at \(3\). The unrestricted estimates would be \(4\) and \(8\), whose sum is \(12\); they are infeasible. The restriction reallocates the discrepancy across the two group means rather than allowing an estimate that violates the fixed sum.

Reparameterization requires care. A transformation that only covers part of the feasible set can silently exclude the maximum. A transformation should also be checked for identifiability: different values of \(\phi\) should not represent the same \(\theta\) in a way that creates unnecessary ambiguity. For example, exponentiating a parameter enforces strict positivity, but cannot attain zero for any finite transformed parameter. If zero is an allowed boundary value and could maximize the likelihood, that transformation does not cover the full feasible set.

Inequality Constraints and KKT Conditions

For differentiable constraints \(g_j(\theta)\geq0\), write the Lagrangian for maximization as \(\mathcal{L}(\theta,\lambda)=\ell(\theta)+\sum_j\lambda_j g_j(\theta)\), with multipliers \(\lambda_j\). Under a suitable constraint qualification, such as linearly independent gradients of the active constraints, a local optimum must satisfy the KKT conditions:

Theorem: At a regular local maximum with constraints \(g_j(\theta)\geq0\), there are multipliers \(\lambda_j\) such that (1) \(\nabla_\theta\ell(\hat{\theta})+\sum_j\lambda_j\nabla_\theta g_j(\hat{\theta})=0\) (stationarity), (2) \(g_j(\hat{\theta})\geq0\) (primal feasibility), (3) \(\lambda_j\geq0\) (dual feasibility), and (4) \(\lambda_jg_j(\hat{\theta})=0\) for every \(j\) (complementary slackness). For equality constraints \(h(\theta)=0\), use unrestricted-sign multipliers and require \(h(\hat{\theta})=0\).

Complementary slackness separates the two cases. If a constraint is inactive, \(g_j(\hat{\theta})>0\), so its multiplier must be zero: it has no local effect on the optimum. If its multiplier is positive, the constraint must be active. Intuitively, at an active boundary the likelihood's gradient can point toward a better value only in a direction that is infeasible. The multiplier measures the local value of relaxing that restriction, in the units associated with the constraint.

Worked Example: A Binomial Probability With an Upper Bound

In hypothetical data, \(8\) successes are observed in \(10\) independent Bernoulli trials with common success probability \(p\). Suppose the model imposes \(p\leq0.6\). Find the constrained maximum-likelihood estimate and verify the KKT conditions.

Model and likelihood. The binomial likelihood is proportional to \(p^8(1-p)^2\), so its log-likelihood, omitting a constant, is \(\ell(p)=8\log p+2\log(1-p)\). Its derivative is \(\ell'(p)=8/p-2/(1-p)=(8-10p)/[p(1-p)]\). The unrestricted maximum is \(8/10=0.8\), which violates the bound. For \(0<p\leq0.6\), the derivative is positive because \(8-10p\geq2>0\). Thus the likelihood is increasing throughout the feasible interval and is maximized at \(\hat{p}=0.6\).

KKT check. Write the restriction as \(g(p)=0.6-p\geq0\). At \(p=0.6\), the score is \(\ell'(0.6)=2/0.24=8.333\), and \(g'(p)=-1\). Stationarity requires \(8.333-\lambda=0\), so \(\lambda=8.333\geq0\). The constraint is feasible and active, and \(\lambda g(\hat{p})=8.333(0)=0\). All four conditions hold.

For comparison, the constrained log-likelihood is \(8\log(0.6)+2\log(0.4)\approx-5.919\), whereas the unrestricted value at \(0.8\) is \(8\log(0.8)+2\log(0.2)\approx-5.004\). The unrestricted value is larger, but it is not an admissible estimate under the imposed model restriction.

Why the KKT Conditions Identify a Constrained Optimum

The stationarity condition follows from considering feasible small changes in the parameter. For clarity, consider one smooth active constraint \(g(\theta)\geq0\), with \(g(\hat{\theta})=0\) and \(\nabla g(\hat{\theta})\neq0\). A direction \(d\) pointing into the feasible region must satisfy \(\nabla g(\hat{\theta})^\mathsf{T}d\geq0\) to first order. At a local maximum, the directional derivative of the log-likelihood cannot be positive in such a direction: \(\nabla\ell(\hat{\theta})^\mathsf{T}d\leq0\).

In particular, directions tangent to the constraint satisfy \(\nabla g(\hat{\theta})^\mathsf{T}d=0\). Both \(d\) and \(-d\) are tangent, so the directional derivative must be zero in every tangent direction. Consequently, \(\nabla\ell(\hat{\theta})\) is proportional to \(\nabla g(\hat{\theta})\). The sign restriction from feasible inward directions makes that proportionality consistent with \(\nabla\ell(\hat{\theta})+\lambda\nabla g(\hat{\theta})=0\) for \(\lambda\geq0\). For multiple regular constraints, the corresponding argument gives a nonnegative combination of the active constraint gradients. Inactive constraints have zero multipliers, yielding complementary slackness.

These conditions are necessary under regularity conditions, not automatically sufficient. In practice, check the constraints, the multipliers, and the curvature of the objective in feasible directions. If the log-likelihood is concave and the feasible set is convex, the KKT conditions are sufficient for a global maximum; without those properties, they may describe only a local candidate.

Worked Example: A Two-Parameter Boundary Solution

Consider the hypothetical log-likelihood kernel \(\ell(\theta_1,\theta_2)=-\tfrac12[(\theta_1-0.8)^2+(\theta_2-0.7)^2]\), subject to \(\theta_1+\theta_2\leq1\). The unrestricted maximum is \((0.8,0.7)\), which violates the constraint because \(0.8+0.7=1.5>1\). Find the constrained maximum.

Write \(g(\theta)=1-\theta_1-\theta_2\geq0\). Its gradient is \((-1,-1)^\mathsf{T}\), while the log-likelihood gradient is \((-(\theta_1-0.8),-(\theta_2-0.7))^\mathsf{T}\). The boundary must be active at the constrained optimum: if it were inactive, stationarity would require the unrestricted maximum \((0.8,0.7)\), which is infeasible.

With multiplier \(\lambda\geq0\), stationarity gives \(\theta_1=0.8-\lambda\) and \(\theta_2=0.7-\lambda\). The active constraint then implies \((0.8-\lambda)+(0.7-\lambda)=1\), so \(1.5-2\lambda=1\), \(\lambda=0.25\). Therefore \(\hat{\theta}_1=0.55\) and \(\hat{\theta}_2=0.45\). The constraint holds with equality and the multiplier is positive.

The Hessian of the log-likelihood is the negative identity matrix, so the log-likelihood is strictly concave; the feasible half-space is convex. The KKT solution is consequently the unique global maximum. Its log-likelihood is \(-\tfrac12[(-0.25)^2+(-0.25)^2]=-0.0625\), lower than the unrestricted maximum value \(0\), as expected when maximizing over a smaller feasible set.

What Constraints Change About Inference

A restriction affects uncertainty as well as the point estimate. For a linear equality restriction \(A\theta=c\), suppose the restriction is part of the model and the likelihood has regular curvature. Let \(I\) denote the information matrix for the unrestricted parameter vector, evaluated at the constrained estimate, and assume \(I\) is nonsingular and \(A\) has full row rank. The large-sample covariance of the constrained estimator, to first order under the restriction, is

$$ I^{-1} - I^{-1}A^\mathsf{T} \left(AI^{-1}A^\mathsf{T}\right)^{-1} AI^{-1}. $$

The subtracted term removes variation in directions forbidden by the equality restrictions. In the two-mean example, the restriction \(\mu_1+\mu_2=10\) removes variation in the sum: estimation uncertainty remains along the line \(\mu_1+\mu_2=10\), not perpendicular to it. Inference should therefore use the constrained covariance or a valid reduced-parameter formulation, rather than treating the two estimates as unrestricted.

An active inequality can likewise place the estimate on the boundary of the feasible set. Standard symmetric Wald intervals based on an unrestricted, unconstrained approximation may then be inappropriate: they can suggest parameter values outside the model, and the usual interior normal approximation need not apply at a boundary. The inferential method must reflect the constraint and whether it is genuinely part of the model. Boundary-specific distributional results require additional care; an active constraint is not, by itself, a reason to report an ordinary unconstrained standard error.

Common Mistakes

  • Estimating first and imposing the restriction afterward. Replacing an infeasible unrestricted estimate with an arbitrary feasible value need not maximize the likelihood over the feasible set. Optimize subject to the restriction.
  • Using the wrong multiplier sign. For a maximization problem written \(g(\theta)\geq0\), use \(\mathcal{L}=\ell+\lambda g\) with \(\lambda\geq0\). Reversing the inequality changes the multiplier convention.
  • Assuming every constraint is active. An inactive constraint has a zero multiplier. Check its value at the solution rather than imposing equality automatically.
  • Treating KKT stationarity as proof of a global maximum. Check curvature and the feasible set, or otherwise establish that the candidate is a maximum rather than a minimum or saddle point.
  • Using an interior standard error at a boundary without checking its validity. Constraints can change both feasible directions and the sampling distribution; inference must respect the restricted parameter space.
Key takeaway: Reparameterization builds equality restrictions into the model, while KKT conditions characterize regular optima under inequality constraints. Verify feasibility, multiplier signs, complementary slackness, and curvature; then base inference on the restricted problem rather than assuming the unconstrained approximation still applies.

Check Your Understanding

Try these questions before reviewing the examples.

  1. Why can an unrestricted score equal zero fail to identify a constrained maximum-likelihood estimate?
  2. For a constraint written \(g(\theta)\geq0\), state the KKT sign restriction on its multiplier and the complementary-slackness condition.
  3. In the binomial example, why is the estimate at \(p=0.6\) rather than at the unrestricted estimate \(p=0.8\)?
  4. What can go wrong if a reparameterization enforces strict positivity when zero is an allowed feasible value?
  5. Why may a symmetric, unrestricted Wald interval be inappropriate when an inequality constraint is active?
Clinical Biostats