Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Stochastic Optimal Control

Introduction

Stochastic optimal control (SOC) is the mathematical theory of making sequential decisions in systems whose state evolves stochastically over time. The agent observes the current state of the system, applies a control, and the system transitions to a new state according to a stochastic law. The goal is to choose a sequence of controls — a policy — that minimises an expected cumulative cost over a finite or infinite horizon. SOC extends classical optimal control theory, which addresses deterministic systems, to the regime where the state dynamics are driven by random processes such as the Wiener process introduced in chapter Stochastic Calculus.

The mathematical tools developed in this chapter provide the foundation for two distinct classes of trading problems addressed later in this book: optimal execution scheduling (chapter Optimal Execution Theory) and optimal market making (chapter Optimal Market Making). In the execution problem, the agent must liquidate an inventory at minimum expected cost while controlling timing risk; the state is the remaining inventory and the control is the trading rate. In the market making problem, the agent must quote bid and ask prices dynamically to maximise expected profit while managing inventory risk; the state is the inventory and the control is the spread quoted around the mid-price. Despite the different economic contexts, both problems share the same mathematical structure: a stochastic dynamical system, a cost functional, and a backward equation — the Bellman equation in discrete time, or the Hamilton–Jacobi–Bellman equation in continuous time — that determines the value of the optimal policy at each state and time.

The chapter is organised as follows. We begin with discrete-time dynamic programming (Dynamic programming in discrete time), which introduces Bellman’s principle of optimality and the backward induction algorithm in the simplest setting. We then extend to continuous-time control (The Hamilton–Jacobi–Bellman equation), where the state follows a stochastic differential equation and the optimal value function satisfies the Hamilton–Jacobi–Bellman (HJB) partial differential equation. We next present the variational approach (The variational approach), which simplifies the optimisation to an ordinary differential equation when the stochastic noise enters the cost functional only through the trajectory of the state — a structure that appears in the Almgren–Chriss model. Finally, we derive the Linear–Quadratic Stochastic Control (LQSC) framework (Linear–Quadratic Stochastic Control), which yields closed-form solutions via Riccati equations and is the method of choice for execution and market making problems with quadratic cost structures.

Dynamic programming in discrete time

Problem setup

We consider a system evolving over discrete time steps k=0,1,,Nk = 0, 1, \ldots, N, where NN is the terminal time. At each step kk the system is in state xkXRnx_k \in \mathcal{X} \subseteq \mathbb{R}^n and the agent selects a control ukU(xk)Rmu_k \in \mathcal{U}(x_k) \subseteq \mathbb{R}^m from a feasible set that may depend on the current state. The state then transitions according to the dynamics

xk+1=fk(xk,uk,wk)x_{k+1} = f_k(x_k, u_k, w_k)

where wkw_k is an exogenous random disturbance with known distribution that is independent of the past history of states and controls. Applying control uku_k in state xkx_k incurs a running cost ck(xk,uk)c_k(x_k, u_k), and reaching terminal state xNx_N incurs a terminal cost ψ(xN)\psi(x_N). The total cost of a sequence of controls u=(u0,u1,,uN1)\mathbf{u} = (u_0, u_1, \ldots, u_{N-1}) is

J(u)=k=0N1ck(xk,uk)+ψ(xN)J(\mathbf{u}) = \sum_{k=0}^{N-1} c_k(x_k, u_k) + \psi(x_N)

This is a random variable because the state trajectory (x0,x1,,xN)(x_0, x_1, \ldots, x_N) depends on the random disturbances (w0,w1,,wN1)(w_0, w_1, \ldots, w_{N-1}). The objective is to find a policy π=(π0,π1,,πN1)\pi = (\pi_0, \pi_1, \ldots, \pi_{N-1}), where πk:XU\pi_k: \mathcal{X} \to \mathcal{U} maps states to controls, that minimises the expected total cost:

minπE[k=0N1ck(xk,πk(xk))+ψ(xN)x0]\min_\pi \, \mathbb{E}\left[\sum_{k=0}^{N-1} c_k(x_k, \pi_k(x_k)) + \psi(x_N) \,\Big|\, x_0\right]

A policy of this form — mapping the state to a control at each step — is called a feedback or closed-loop policy. The key result of dynamic programming is that the optimal policy has exactly this feedback structure: the optimal action at each step depends only on the current state, not on the full history of states and controls.

Bellman’s principle of optimality

The core insight behind dynamic programming is Bellman’s principle of optimality: the tail of an optimal policy is itself optimal. Formally, if (u0,u1,,uN1)(u_0^*, u_1^*, \ldots, u_{N-1}^*) is an optimal policy, then for any intermediate time kk and any state xkx_k reachable under the optimal policy, (uk,uk+1,,uN1)(u_k^*, u_{k+1}^*, \ldots, u_{N-1}^*) is an optimal policy for the sub-problem starting at time kk in state xkx_k.

This principle justifies decomposing the global optimisation into a sequence of local optimisations, solved backwards from the terminal time.

The Bellman equation

Define the value function Vk(x)V_k(x) as the minimum expected cost achievable from state xx at time kk:

Vk(x)=minπk,,πN1E[j=kN1cj(xj,πj(xj))+ψ(xN)xk=x]V_k(x) = \min_{\pi_k, \ldots, \pi_{N-1}} \mathbb{E}\left[\sum_{j=k}^{N-1} c_j(x_j, \pi_j(x_j)) + \psi(x_N) \,\Big|\, x_k = x\right]

The terminal value function is simply the terminal cost: VN(x)=ψ(x)V_N(x) = \psi(x).

By the principle of optimality, applying the optimal first action uku_k^* and then following the optimal policy from the resulting state xk+1x_{k+1} gives:

Vk(x)=minuU(x)Ewk[ck(x,u)+Vk+1(fk(x,u,wk))]\boxed{V_k(x) = \min_{u \in \mathcal{U}(x)} \mathbb{E}_{w_k}\left[c_k(x, u) + V_{k+1}(f_k(x, u, w_k))\right]}

with VN(x)=ψ(x)V_N(x) = \psi(x). This is the Bellman equation (or dynamic programming equation). It reduces the optimisation over sequences of controls into a sequence of single-step optimisations, each requiring only the value function at the next step. The optimal policy at step kk is recovered from the minimiser:

πk(x)=argminuU(x)Ewk[ck(x,u)+Vk+1(fk(x,u,wk))]\pi_k^*(x) = \arg\min_{u \in \mathcal{U}(x)} \mathbb{E}_{w_k}\left[c_k(x, u) + V_{k+1}(f_k(x, u, w_k))\right]

Backward induction algorithm

The Bellman equation defines a backward induction algorithm for computing the optimal value function and policy:

  1. Initialise: set VN(x)=ψ(x)V_N(x) = \psi(x) for all states xx.

  2. For k=N1,N2,,0k = N-1, N-2, \ldots, 0:

    • For each state xXx \in \mathcal{X}, compute:

      Vk(x)=minuU(x)Ewk[ck(x,u)+Vk+1(fk(x,u,wk))]V_k(x) = \min_{u \in \mathcal{U}(x)} \mathbb{E}_{w_k}\left[c_k(x, u) + V_{k+1}(f_k(x, u, w_k))\right]
    • Record the minimiser as πk(x)\pi_k^*(x).

The algorithm sweeps backwards from the terminal time, propagating value information from the future into the current decision. Once all VkV_k and πk\pi_k^* are computed, the optimal forward trajectory is obtained by simulating the system under π\pi^* from x0x_0.

The feasibility of the algorithm depends on the structure of the problem. When X\mathcal{X} is finite and small, the expectation and minimisation can be computed explicitly. When X\mathcal{X} is continuous, the value function is defined over an uncountable domain, and special structure must be exploited to obtain tractable solutions. The LQSC framework in Linear–Quadratic Stochastic Control provides one such tractable case.

Example: discrete inventory liquidation

Consider a trader who must sell XX shares over NN time periods. Let the state be the remaining inventory xk{0,1,,X}x_k \in \{0, 1, \ldots, X\} and the control be the number of shares sold in period kk: uk{0,1,,xk}u_k \in \{0, 1, \ldots, x_k\}. The inventory dynamics are xk+1=xkukx_{k+1} = x_k - u_k (deterministic, no noise). The price in period kk is SkS_k and the execution price is Pk=SkηukP_k = S_k - \eta u_k (linear temporary impact). Suppose the price evolves as Sk+1=Sk+ϵk+1S_{k+1} = S_k + \epsilon_{k+1} with ϵk\epsilon_k i.i.d. zero-mean noise.

The total proceeds are k=0N1ukPk=k=0N1uk(Skηuk)\sum_{k=0}^{N-1} u_k P_k = \sum_{k=0}^{N-1} u_k (S_k - \eta u_k), and we impose the constraint k=0N1uk=X\sum_{k=0}^{N-1} u_k = X (all shares must be sold). The expected total proceeds are:

E[k=0N1ukSkηk=0N1uk2]\mathbb{E}\left[\sum_{k=0}^{N-1} u_k S_k - \eta \sum_{k=0}^{N-1} u_k^2\right]

Since prices follow a martingale (E[Sk]=S0\mathbb{E}[S_k] = S_0) and the inventory xk=Xj<kujx_k = X - \sum_{j<k} u_j is determined by prior decisions, this problem has quadratic structure. Bertsimas and Lo Bertsimas & Lo, 1998 show that the optimal policy under this formulation distributes the remaining inventory equally at each step: uk=xk/(Nk)u_k^* = x_k / (N - k), recovering the TWAP schedule. The value function is quadratic in the state, a structure that carries over to the continuous-time case and the LQSC framework.

The Hamilton–Jacobi–Bellman equation

From discrete to continuous time

The discrete-time Bellman equation can be extended to continuous time by taking the step size Δt0\Delta t \to 0. Consider the state dynamics

dXt=μ(Xt,ut,t)dt+σ(Xt,t)dWtdX_t = \mu(X_t, u_t, t) \, dt + \sigma(X_t, t) \, dW_t

where WtW_t is a standard Wiener process (see chapter Stochastic Calculus), and the running cost c(t,Xt,ut)dtc(t, X_t, u_t) \, dt is incurred continuously. The state is XtRnX_t \in \mathbb{R}^n, the control is utUu_t \in \mathcal{U}, and the drift μ\mu is allowed to depend on the control while the volatility σ\sigma does not (for simplicity; this restriction can be relaxed). The value function is defined as:

J(t,x)=min{us}tsTE[tTc(s,Xs,us)ds+ψ(XT)Xt=x]J(t, x) = \min_{\{u_s\}_{t \leq s \leq T}} \mathbb{E}\left[\int_t^T c(s, X_s, u_s) \, ds + \psi(X_T) \,\Bigg|\, X_t = x\right]

and satisfies J(T,x)=ψ(x)J(T, x) = \psi(x). We seek the partial differential equation (PDE) that JJ satisfies for t<Tt < T.

HJB derivation

Applying the Bellman principle over the short interval [t,t+dt][t, t + dt]:

J(t,x)=minuUE[c(t,x,u)dt+J(t+dt,Xt+dt)Xt=x]J(t, x) = \min_{u \in \mathcal{U}} \, \mathbb{E}\left[c(t, x, u) \, dt + J(t + dt, X_{t+dt}) \,\Big|\, X_t = x\right]

Using Ito’s lemma (chapter Stochastic Calculus, Paragraph) to expand J(t+dt,Xt+dt)J(t + dt, X_{t+dt}):

J(t+dt,Xt+dt)=J(t,x)+Jtdt+JxdXt+122Jx2(dXt)2J(t + dt, X_{t+dt}) = J(t, x) + \frac{\partial J}{\partial t} dt + \frac{\partial J}{\partial x} dX_t + \frac{1}{2} \frac{\partial^2 J}{\partial x^2} (dX_t)^2

Taking expectations and using (dXt)2=σ2(x,t)dt(dX_t)^2 = \sigma^2(x,t) \, dt and E[dWt]=0\mathbb{E}[dW_t] = 0:

E[J(t+dt,Xt+dt)Xt=x]=J(t,x)+(Jt+μ(x,u,t)Jx+12σ2(x,t)2Jx2)dt\mathbb{E}[J(t+dt, X_{t+dt}) | X_t = x] = J(t,x) + \left(\frac{\partial J}{\partial t} + \mu(x, u, t) \frac{\partial J}{\partial x} + \frac{1}{2}\sigma^2(x,t) \frac{\partial^2 J}{\partial x^2}\right) dt

Substituting back into the Bellman equation and rearranging:

Jt=minuU[c(t,x,u)+μ(x,u,t)Jx+12σ2(x,t)2Jx2]\boxed{-\frac{\partial J}{\partial t} = \min_{u \in \mathcal{U}} \left[c(t, x, u) + \mu(x, u, t) \frac{\partial J}{\partial x} + \frac{1}{2}\sigma^2(x,t) \frac{\partial^2 J}{\partial x^2}\right]}

with terminal condition J(T,x)=ψ(x)J(T, x) = \psi(x). This is the Hamilton–Jacobi–Bellman (HJB) equation. It is a nonlinear PDE running backwards in time from the terminal condition. The optimal control u(t,x)u^*(t,x) is the minimiser of the right-hand side at each (t,x)(t,x):

u(t,x)=argminuU[c(t,x,u)+μ(x,u,t)Jx]u^*(t, x) = \arg\min_{u \in \mathcal{U}} \left[c(t, x, u) + \mu(x, u, t) \frac{\partial J}{\partial x}\right]

Once the HJB PDE is solved for JJ and the optimal control uu^* is obtained in feedback form, the optimal policy generates the optimal state trajectory by forward simulation under u(t,Xt)u^*(t, X_t).

For multivariate states XtRnX_t \in \mathbb{R}^n driven by a multivariate Wiener process WtRdW_t \in \mathbb{R}^d, with dynamics dXt=μ(Xt,ut,t)dt+Σ(Xt,t)dWtdX_t = \mu(X_t, u_t, t) \, dt + \Sigma(X_t, t) \, dW_t, the HJB equation generalises to:

Jt=minuU[c(t,x,u)+μ(x,u,t)TxJ+12tr(ΣΣTxx2J)]-\frac{\partial J}{\partial t} = \min_{u \in \mathcal{U}} \left[c(t, x, u) + \mu(x, u, t)^T \nabla_x J + \frac{1}{2} \text{tr}\left(\Sigma \Sigma^T \nabla_{xx}^2 J\right)\right]

where xJ\nabla_x J is the gradient vector and xx2J\nabla_{xx}^2 J is the Hessian matrix of JJ with respect to xx.

Terminal conditions and boundary conditions

The HJB equation is solved backwards from the terminal condition J(T,x)=ψ(x)J(T, x) = \psi(x), which encodes the terminal cost at the end of the horizon. For execution problems, the most common terminal cost is a large penalty for failing to liquidate the full position:

ψ(xT)=AxT2,A\psi(x_T) = A \, x_T^2, \quad A \to \infty

which forces xT0x_T \approx 0 in the limit. The terminal condition thus encodes the hard constraint that the position must be closed at the end of the trading horizon. In practice, a large but finite AA corresponds to the cost of liquidating any residual at market at time TT.

Connection to the Feynman–Kac theorem

Once the optimal control u(t,x)u^*(t, x) is substituted back into the HJB equation, the resulting PDE is linear in JJ and takes the form covered by the Feynman–Kac theorem (chapter Stochastic Calculus, section The Feynman - Kac Theorem):

Jt+μ(x,t)Jx+12σ2(x,t)2Jx2rJ+c(t,x)=0\frac{\partial J}{\partial t} + \mu^*(x, t) \frac{\partial J}{\partial x} + \frac{1}{2}\sigma^2(x,t) \frac{\partial^2 J}{\partial x^2} - r \, J + c^*(t, x) = 0

where μ=μ(x,u(t,x),t)\mu^* = \mu(x, u^*(t,x), t) and c=c(t,x,u(t,x))c^* = c(t, x, u^*(t,x)) are the optimal drift and cost. The Feynman–Kac theorem then identifies J(t,x)J(t, x) with the expected discounted cost under the optimal dynamics:

J(t,x)=E[tTer(st)c(s,Xs)ds+er(Tt)ψ(XT)Xt=x]J(t, x) = \mathbb{E}\left[\int_t^T e^{-r(s-t)} c^*(s, X_s) \, ds + e^{-r(T-t)}\psi(X_T) \,\Bigg|\, X_t = x\right]

This confirms the probabilistic interpretation of the value function and provides a Monte Carlo method for computing JJ numerically when the PDE is not analytically tractable.

The variational approach

Calculus of variations

The calculus of variations studies functionals — real-valued functions whose argument is itself a function — and asks: for what function is a given functional minimised or maximised? In the control problems of interest, the functional is the expected total cost and the unknown is the trajectory of the state variable.

Consider minimising the functional

F[x]=0TL(t,xt,x˙t)dt\mathcal{F}[x] = \int_0^T L(t, x_t, \dot{x}_t) \, dt

over smooth trajectories x:[0,T]Rx: [0, T] \to \mathbb{R} subject to fixed boundary conditions x(0)=x0x(0) = x_0 and x(T)=xTx(T) = x_T. The integrand L(t,x,x˙)L(t, x, \dot{x}) is called the Lagrangian. The trajectory xx^* that extremises F\mathcal{F} satisfies the Euler–Lagrange equation:

LxddtLx˙=0\frac{\partial L}{\partial x} - \frac{d}{dt}\frac{\partial L}{\partial \dot{x}} = 0

This is a second-order ordinary differential equation for xtx_t, solved subject to the two boundary conditions.

The variational approach applies directly to stochastic optimal control problems in which the noise enters the cost functional only through the trajectory of the state — not through the control variable itself. This occurs in the Almgren–Chriss model, where:

In such cases, the stochastic optimisation reduces to a deterministic variational problem.

Euler–Lagrange equation for execution

In the Almgren–Chriss model (derived in detail in chapter Optimal Execution Theory), the Lagrangian takes the form

L(x,x˙)=ηx˙2+λσ2x2L(x, \dot{x}) = \eta \dot{x}^2 + \lambda \sigma^2 x^2

where η>0\eta > 0 is the temporary market impact coefficient, σ\sigma is the price volatility, and λ0\lambda \geq 0 is the risk-aversion parameter. The Euler–Lagrange equation gives:

LxddtLx˙=2λσ2x2ηx¨=0\frac{\partial L}{\partial x} - \frac{d}{dt}\frac{\partial L}{\partial \dot{x}} = 2\lambda\sigma^2 x - 2\eta \ddot{x} = 0

equivalently,

x¨=κ2x,κλσ2η\ddot{x} = \kappa^2 x, \quad \kappa \equiv \sqrt{\frac{\lambda \sigma^2}{\eta}}

This is a second-order linear ODE with constant coefficients. The general solution is:

xt=Asinh(κt)+Bcosh(κt)x_t = A \sinh(\kappa t) + B \cosh(\kappa t)

where AA and BB are determined by the boundary conditions x0=Xx_0 = X (initial inventory) and xT=0x_T = 0 (complete liquidation). This yields the unique optimal trajectory:

xt=Xsinh(κ(Tt))sinh(κT)x_t^* = X \, \frac{\sinh(\kappa(T-t))}{\sinh(\kappa T)}

The parameter κ\kappa controls the shape of the trajectory: for κ0\kappa \to 0 (risk-neutral, λ0\lambda \to 0), the trajectory reduces to a linear decrease xt=X(1t/T)x_t^* = X(1 - t/T) — the TWAP schedule. For large κ\kappa (highly risk-averse), the trajectory front-loads aggressively, liquidating most of the position early and leaving only a small residual towards the end.

Hyperbolic solution structure

The hyperbolic sine and cosine functions that appear in the solution have a natural interpretation. Define the half-life τ=1/κ\tau^* = 1/\kappa as the characteristic time over which the optimal strategy departs significantly from the risk-neutral uniform schedule. For TτT \ll \tau^* (short horizon relative to the risk-aversion scale), the solution is approximately linear: xtX(1t/T)x_t^* \approx X(1 - t/T). For TτT \gg \tau^*, the solution approximates an exponential decay in the early portion, then abruptly falls to zero near TT.

The trading rate is

vt=x˙t=κXcosh(κ(Tt))sinh(κT)v_t^* = -\dot{x}_t^* = \kappa X \, \frac{\cosh(\kappa(T-t))}{\sinh(\kappa T)}

This is a decreasing function of time: the optimal strategy sells most aggressively at time t=0t = 0 and slows down as the horizon approaches — front-loading to reduce exposure to price risk from holding a large unexecuted inventory, at the cost of higher early market impact.

Linear–Quadratic Stochastic Control

Problem setup

Linear–Quadratic Stochastic Control (LQSC) is a class of stochastic control problems in which:

These three properties together guarantee that the value function is quadratic in the state, the optimal control is affine (linear plus a constant) in the state, and the optimal gains satisfy a backwards Riccati equation — a system of ODEs or recursions that can be solved analytically or efficiently numerically.

In discrete time, the LQSC problem is:

min{uk}E[k=0N1(xkTQkxk+ukTRkuk+2qkTxk+2rkTuk)+xNTPNxN+2pNTxN]\min_{\{u_k\}} \mathbb{E}\left[\sum_{k=0}^{N-1} \left(x_k^T Q_k x_k + u_k^T R_k u_k + 2 q_k^T x_k + 2 r_k^T u_k\right) + x_N^T P_N x_N + 2 p_N^T x_N\right]

subject to the linear dynamics

xk+1=Akxk+Bkuk+ck+wkx_{k+1} = A_k x_k + B_k u_k + c_k + w_k

where xkRnx_k \in \mathbb{R}^n is the state, ukRmu_k \in \mathbb{R}^m is the control, wkN(0,Wk)w_k \sim \mathcal{N}(0, W_k) is a Gaussian disturbance independent of xkx_k and uku_k, AkRn×nA_k \in \mathbb{R}^{n \times n}, BkRn×mB_k \in \mathbb{R}^{n \times m}, Qk0Q_k \succeq 0, Rk0R_k \succ 0, and PN0P_N \succeq 0.

The quadratic value function ansatz

The key observation is that the Bellman equation preserves the quadratic structure of the value function. We postulate:

Vk(x)=xTPkx+2pkTx+qkV_k(x) = x^T P_k x + 2 p_k^T x + q_k

and verify that this form is consistent with the Bellman equation. Substituting the ansatz into the Bellman equation and minimising over uku_k (which is unconstrained for simplicity):

The minimand is:

xTQkx+2qkTx+uTRku+2rkTu+(Akx+Bku+ck)TPk+1(Akx+Bku+ck)+x^T Q_k x + 2q_k^T x + u^T R_k u + 2r_k^T u + (A_k x + B_k u + c_k)^T P_{k+1}(A_k x + B_k u + c_k) + \ldots

Taking the derivative with respect to uu and setting to zero:

2Rku+2BkTPk+1(Akx+Bku+ck)+2(rk+BkTpk+1)=02 R_k u + 2 B_k^T P_{k+1}(A_k x + B_k u + c_k) + 2(r_k + B_k^T p_{k+1}) = 0

Solving for the optimal control:

uk=Kkxk+k\boxed{u_k^* = K_k x_k + \ell_k}

where

Kk=(Rk+BkTPk+1Bk)1BkTPk+1AkK_k = -(R_k + B_k^T P_{k+1} B_k)^{-1} B_k^T P_{k+1} A_k
k=(Rk+BkTPk+1Bk)1(BkTPk+1ck+BkTpk+1+rk)\ell_k = -(R_k + B_k^T P_{k+1} B_k)^{-1}(B_k^T P_{k+1} c_k + B_k^T p_{k+1} + r_k)

The optimal control is affine in the state: a linear feedback term KkxkK_k x_k plus a constant correction k\ell_k. The feedback gain KkK_k depends only on the matrices of the problem, not on the realisation of noise.

Riccati equations

Substituting the optimal control back into the Bellman equation yields recursions for the coefficients PkP_k, pkp_k, qkq_k, which are the matrix Riccati equations:

Pk=Qk+AkTPk+1AkAkTPk+1Bk(Rk+BkTPk+1Bk)1BkTPk+1Ak\boxed{P_k = Q_k + A_k^T P_{k+1} A_k - A_k^T P_{k+1} B_k (R_k + B_k^T P_{k+1} B_k)^{-1} B_k^T P_{k+1} A_k}
pk=qk+AkTpk+1AkTPk+1Bk(Rk+BkTPk+1Bk)1(BkTpk+1+rk)+AkTPk+1ckp_k = q_k + A_k^T p_{k+1} - A_k^T P_{k+1} B_k (R_k + B_k^T P_{k+1} B_k)^{-1}(B_k^T p_{k+1} + r_k) + A_k^T P_{k+1} c_k

with terminal conditions PNP_N and pNp_N given. The noise term wkw_k contributes only to the scalar qkq_k, not to PkP_k or pkp_k: this is the certainty equivalence property of LQSC — the optimal feedback gains are identical to those of the deterministic version of the problem (obtained by setting wk=0w_k = 0), and noise only increases the expected cost.

The computational cost of the Riccati recursion is O(Nn3)O(Nn^3) (matrix inversions at each of NN steps for nn-dimensional state), which is tractable for the problem sizes arising in execution (state dimension 2–4, horizon NN = 20–400 time bins).

Scalar LQSC: the Riccati recursion in closed form

For the scalar case (n=m=1n = m = 1, Ak=aA_k = a, Bk=bB_k = b, Qk=qQ_k = q, Rk=rR_k = r), the Riccati recursion simplifies to:

Pk=q+a2Pk+1a2b2Pk+12r+b2Pk+1P_k = q + a^2 P_{k+1} - \frac{a^2 b^2 P_{k+1}^2}{r + b^2 P_{k+1}}

This can be written as:

Pk=q+a2rPk+1r+b2Pk+1P_k = q + \frac{a^2 r P_{k+1}}{r + b^2 P_{k+1}}

which is a scalar nonlinear recursion that can be evaluated numerically with PNP_N as the terminal condition. For the stationary case (aa, bb, qq, rr constant), the recursion converges as NN \to \infty to the fixed point of the algebraic Riccati equation P=q+a2rP/(r+b2P)P^* = q + a^2 r P^* / (r + b^2 P^*).

Continuous-time LQSC

In continuous time, the LQSC problem is:

min{ut}E[0T(xtTQtxt+utTRtut)dt+xTTPTxT]\min_{\{u_t\}} \mathbb{E}\left[\int_0^T \left(x_t^T Q_t x_t + u_t^T R_t u_t\right) dt + x_T^T P_T x_T\right]

subject to dXt=(AtXt+Btut)dt+ΣtdWtdX_t = (A_t X_t + B_t u_t) \, dt + \Sigma_t \, dW_t. The HJB equation is:

P˙t=Qt+AtTPt+PtAtPtBtRt1BtTPt-\dot{P}_t = Q_t + A_t^T P_t + P_t A_t - P_t B_t R_t^{-1} B_t^T P_t

with terminal condition PTP_T (matrix-valued). This is the continuous-time matrix Riccati ODE. The optimal control is ut=Rt1BtTPtxtu_t^* = -R_t^{-1} B_t^T P_t x_t — a linear feedback policy with time-varying gain Kt=Rt1BtTPtK_t = -R_t^{-1} B_t^T P_t. The certainty-equivalence property holds: the Riccati ODE does not depend on the noise covariance Σt\Sigma_t, which affects only the expected cost, not the optimal gains.

Structured extensions for execution problems

Both the VWAP execution problem and the market making problem introduce additional structure: the state vector includes not only the inventory but also a stochastic auxiliary state (the cumulative market volume for VWAP, or the asset price for market making) that is not directly controlled. The LQSC framework handles this naturally by extending the state vector and setting the corresponding control gain to zero.

More precisely, in the VWAP problem (chapter Optimal Execution Theory), the state is xk=(Qk,Vk)Tx_k = (Q_k, V_k)^T where QkQ_k is the cumulative order executed and VkV_k is the cumulative market volume. The market volume VkV_k evolves stochastically and independently of the control qkq_k (shares executed in bin kk). The Riccati recursion then produces gains Kk=(Kk,1,Kk,2)K_k = (K_{k,1}, K_{k,2}) where Kk,1K_{k,1} governs feedback on the execution shortfall and Kk,2K_{k,2} governs adaptation to observed volume. This adaptive structure is what makes the dynamic VWAP strategy superior to its static counterpart.

Exercises

  1. Consider a one-dimensional control problem with dynamics xk+1=xkukx_{k+1} = x_k - u_k (deterministic), cost k=0N1uk2+λxk2\sum_{k=0}^{N-1} u_k^2 + \lambda x_k^2, and terminal cost ψ(xN)=AxN2\psi(x_N) = A x_N^2 with AA \to \infty (complete liquidation). Apply the LQSC backward recursion to find the optimal control uk(x)u_k^*(x) for N=3N = 3 steps and λ=0\lambda = 0. Verify that the result is the equal-slicing TWAP schedule.

  2. Derive the Euler–Lagrange equation for the Lagrangian L(x,x˙)=x˙2f(t)+λg(t)x2L(x, \dot{x}) = \frac{\dot{x}^2}{f(t)} + \lambda g(t) x^2, where f(t)f(t) and g(t)g(t) are positive functions of time. Show that the resulting ODE reduces to the Almgren–Chriss equation when f(t)=ηf(t) = \eta and g(t)=σ2g(t) = \sigma^2 are constants.

  3. Consider the HJB equation for a one-dimensional stochastic control problem with dXt=utdt+σdWtdX_t = u_t \, dt + \sigma \, dW_t, running cost c(x,u)=u2c(x, u) = u^2 and terminal cost ψ(x)=λx2\psi(x) = \lambda x^2. Postulate J(t,x)=a(t)x2+b(t)J(t, x) = a(t) x^2 + b(t) and derive the ODEs for a(t)a(t) and b(t)b(t) by substituting into the HJB equation. Solve for a(t)a(t) and identify the optimal feedback control u(t,x)u^*(t, x).

  4. In the LQSC framework with scalar state, let A=1A = 1, B=1B = 1, Q=0Q = 0, R=ηR = \eta, and terminal condition PN=AtermP_N = A_{\text{term}}. Write the Riccati recursion and solve it exactly for N=1N = 1 and N=2N = 2. What is the optimal control u0u_0^* in each case given x0=Xx_0 = X?

  5. Explain why the certainty-equivalence principle holds in LQSC: the optimal feedback gains are the same as in the deterministic version of the problem, regardless of the noise level σ\sigma. What structural property of the problem — linearity of dynamics, quadratic cost, Gaussian noise — is responsible for this? Would certainty equivalence still hold if the cost function were ut|u_t| instead of ut2u_t^2?

  6. Write the HJB equation for the following problem: a market maker holds inventory qtq_t and quotes a spread of δt\delta_t around the mid-price StS_t. Trades arrive from clients at a Poisson rate λ(δt)\lambda(\delta_t) (decreasing in δt\delta_t), and each trade changes the inventory by ±1\pm 1. The price StS_t follows a Brownian motion with volatility σ\sigma. The market maker maximises expected profit E[0Tδtλ(δt)dtϕqT2]\mathbb{E}[\int_0^T \delta_t \lambda(\delta_t) dt - \phi q_T^2] where ϕ\phi is an inventory penalty. Identify the state variables, the control, and the structure of the HJB equation, without solving it. (This problem is treated in chapter Optimal Market Making.)

References
  1. Bertsimas, D., & Lo, A. W. (1998). Optimal control of execution costs. Journal of Financial Markets, 1(1), 1–50.