The stochastic maximum principle
Fix a minimizing Hamiltonian convention and check an adjoint backward equation in an LQ diffusion.
On this page
The question for today
What you’ll understand
- Write a minimizing Hamiltonian and its terminal adjoint BSDE with consistent signs.
- Distinguish a necessary first-order inequality from sufficient convex optimality conditions.
- Verify the state, adjoint, and action equations for an explicit scalar model.
Dynamic programming studies a value over all starting states. The stochastic maximum principle instead follows one candidate controlled trajectory and introduces dual processes that measure the effect of perturbing its action. Its familiar name does not force a maximization convention: we will use a Hamiltonian appropriate to minimizing cost. Keeping that convention fixed is essential when reading an adjoint equation, because other sources reverse the adjoint sign and maximize a different Hamiltonian.
The adjoint has terminal data and must remain adapted
For the running-plus-terminal minimizing objective, define H as running cost plus drift paired with p plus diffusion paired with q. The adjoint solves a backward stochastic differential equation with drift minus the state derivative of H and terminal value equal to the terminal-cost gradient. The martingale coefficient q is part of the unknown adapted solution. Simply reversing a deterministic adjoint ODE in time would generally use future noise and would not preserve adaptedness.
Assume the state coefficients and costs have sufficient state and action derivatives, the first-variation state equations are well posed, and the state, adjoint, and product-integral terms have the moments needed for integration by parts and expectation. These hypotheses justify dualizing the cost variation. Bounded derivative conditions are one convenient sufficient framework; quadratic examples can instead use their explicit moment estimates. Existence of a formal terminal equation alone is not a complete maximum-principle theorem.
Necessity and sufficiency have different hypotheses
For a convex action set and valid convex control variations, an optimal action satisfies the first-order variational inequality involving the action derivative of H. If the minimizer is interior, this derivative vanishes. This is a necessary stationarity condition, not a guarantee of a global minimum. When diffusion depends on the action, its derivative contributes through q. Nonconvex action sets with spike variations can require second-order adjoint terms, beyond this first-order convex-control formulation.
A useful sufficient theorem assumes convex terminal cost and joint convexity of H in state and action along the candidate adjoint, together with admissibility and the integration-by-parts moment conditions. If the candidate globally minimizes H in the action, the convex inequalities bound the cost difference below by zero. Without convexity, stationary trajectories can be locally poor or globally suboptimal. The distinction is already visible in a scalar quartic cost with a stationary point that is actually a local maximum.
An LQ example closes both forward and backward equations
For scalar drift u, constant diffusion, effort , and terminal cost , the Hamiltonian action minimizer is . Its state derivative is zero. Try the adapted adjoint with terminal P equal to one. Itô's formula shows that its drift vanishes exactly when , and its martingale coefficient is . The terminal adjoint condition and the state feedback then agree simultaneously.
The positive solution gives finite-horizon linear feedback and finite second moments. The Hamiltonian is jointly convex in state and action because it is independent of state and quadratic in action, and the terminal cost is convex. Hence the stated sufficient conditions certify this candidate. It also agrees with the smooth HJB solution, but that agreement is a feature we have checked in this regular example, not an assumption that every maximum-principle trajectory comes from a differentiable value.
Work it through
Check the scalar state–adjoint pair
Use horizon one, initial state two, and diffusion coefficient one half in the scalar LQ problem. Find the initial adjoint, action, and martingale coefficient. Verify the adjoint drift and compare the optimal cost with the zero-control cost.
The coefficient is , so initially P is one half. Therefore p equals one, u equals minus one, and q equals one quarter at the starting state. The feedback remains state dependent after this initial instant.
For , the drift is , which is zero. The diffusion coefficient is , and at the terminal time p equals the terminal state, as required by the derivative of the terminal cost.
The verified quadratic value is . Under zero control, the terminal second moment is , giving cost . Convexity and moment conditions certify the lower feedback cost.
Initially (p,u,q)=(1,−1,1/4). The feedback candidate satisfies the adapted adjoint equation and achieves cost 1+(log 2)/8.
The living notebook
Explore the model
Interactive lab · optimization
Separate an optimality condition from a numerical iteration
The Hamiltonian gap in the scalar example is (u+p)²/2 for fixed p. Write z=u+p. Pause and Reset, then set step size to 0.5 and initial position to 1; predict z=0.5 after one Step and 0.25 after two. For a fresh comparison Reset, set step size to 2.2 and initial position to 1; after two Steps z=1.44, showing numerical divergence even though the quadratic has a unique minimum. This instrument does not solve the adjoint BSDE. Parameter changes retain elapsed time; reset and set both controls for each comparison.
- Position x0
- 2
- Objective x²/2
- 2
- Iteration behavior
- Stable step
Gradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA correct convex minimizer can coexist with an unstable numerical search; neither replaces the adapted adjoint and its hypotheses.
Pause & reason
Check your understanding
Your turn
Try it yourself
At time one of a horizon-two scalar LQ problem, suppose the state is minus two and diffusion is one. Compute P, p, u, and q. Separately show why stationarity of the scalar cost at zero would not certify a minimum.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
One unit of horizon remains. For the quartic example, compare its value at zero with its values at plus and minus one.
Compare with the solution
The coefficient is one half, so p is minus one, u is one, and q is one half. The terminal adjoint still has positive-gradient convention. For the quartic, the derivative vanishes at zero, but the cost there is one, while at either one or minus one it is zero. The nonconvex stationary point therefore fails to minimize globally, illustrating why first-order necessity needs additional hypotheses for sufficiency.
Keep the idea
Take it with you
- The minimizing Hamiltonian gives terminal adjoint Dg and backward drift −H_x.
- First-order necessity alone does not imply global optimality.
- Joint Hamiltonian convexity, convex terminal cost, admissibility, and moment conditions can provide sufficiency.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.