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.

Convergence and Error Bounds for Approximate Value Iteration

The previous chapter ended with function iteration, vk+1=PLvkv_{k+1} = \Proj\Bellman v_k: value iteration with a fit after each backup. On the fishery it converged with one basis and diverged with another, and the explanation, that the fit must be a nonexpansion in the sup norm, was asserted without proof. This chapter supplies the proofs. It asks when the fit preserves the contraction of the Bellman operator, maximum included, how far from v∗v^* the iteration ends, and what is known when the contraction is lost. Throughout, the model is known and every expectation is computed exactly; the next chapter replaces both by data.

The object of study is the one the previous chapter left: the iteration vk+1=PLvkv_{k+1} = \Proj\Bellman v_k, in which L\Bellman is applied exactly and P\Proj is the approximation step chosen by the method. For collocation, P\Proj interpolates the backups at the nodes; for Galerkin and least squares, it projects them onto the span of the basis in a weighted norm. We call P\Proj the fit, and ask which properties of P\Proj keep the iteration convergent.

The answers come in three kinds. Fits that only average their targets, the averagers, keep the iteration a contraction for the optimality equation; they include grid interpolation, state aggregation and fixed-partition trees. Least squares on a basis is not an averager, and it diverges on a two-state problem whose value function it represents exactly. For evaluating a fixed policy with linear features, least squares weighted by the stationary distribution of the policy is safe as well, a special case that explains LSTD and, in the next chapter, temporal-difference learning. Newton’s method, the other solver of the previous chapter, becomes approximate policy iteration. The chapter closes with what operations research, control, numerical analysis and economics know about approximate solutions of the optimality equation.

Function Iteration Can Diverge

Value iteration converges because L\Bellman is a γ\gamma-contraction in the sup norm (Proposition 2), and the fit can undo that. The fishery of A Motivating Example: Harvesting a Fishery Near a Tipping Point ran function iteration with collocation, once with hat functions and once with Chebyshev polynomials, and its sweep over nn showed the polynomial diverging for some nn. The cell below measures what happens to the fitted values at the nodes from one iteration to the next. The maximization over the escapement and the quadrature over the shock are done by the module that produced the figures of the previous chapter.

Source
import sys
from pathlib import Path

import numpy as np

code_directory = Path.cwd() / "code"
if str(code_directory) not in sys.path:
    sys.path.insert(0, str(code_directory))
from fishery_tipping_point import Bellman, ChebyshevBasis, HatBasis, solve_exact

bellman = Bellman()                  # backups on a fine grid of escapements, 21 quadrature nodes
exact = solve_exact(bellman)         # reference solution


def collocation(basis, max_iter=2000):
    theta = np.zeros(basis.n)
    steps = []
    for k in range(max_iter):
        v = basis.function(theta)
        targets = bellman.apply(v, basis.nodes)        # t_i = (L v_theta)(s_i)
        new = basis.fit(targets)                       # solve Phi theta = t
        steps.append(np.abs(basis.function(new)(basis.nodes) - v(basis.nodes)).max())
        theta = new
        if steps[-1] < 1e-10 or steps[-1] > 1e8:
            break
    return basis.function(theta), np.array(steps)


print(f"{'basis':<30}{'step 10':>10}{'step 100':>11}{'last step':>11}"
      f"{'iterations':>12}{'rate':>7}{'max error':>11}")
for basis in (HatBasis(12), ChebyshevBasis(12), ChebyshevBasis(10)):
    v, steps = collocation(basis)
    rate = np.median(steps[50:150] / steps[49:149])
    error = np.abs(v(bellman.x) - exact.v).max()
    label = f"{basis.name}, n = {basis.n}"
    print(f"{label:<30}{steps[9]:>10.2e}{steps[99]:>11.2e}{steps[-1]:>11.2e}"
          f"{len(steps):>12}{rate:>7.3f}{error:>11.3g}")
basis                            step 10   step 100  last step  iterations   rate  max error
Piecewise linear, n = 12        9.59e-02   9.45e-04   9.96e-11         413  0.950      0.521
Chebyshev polynomial, n = 12    9.92e-02   8.59e-04   9.63e-11         412  0.950       1.66
Chebyshev polynomial, n = 10    1.07e-01   5.06e+00   1.05e+08         452  1.049   2.79e+09

With 12 coefficients, both bases converge, and the change per iteration shrinks by the factor γ=0.95\gamma = 0.95, as in value iteration. They converge to different fixed points, with errors of about 0.5 and 1.7. With 10 Chebyshev coefficients, the change instead grows by about 5% per iteration, and the coefficients run off to infinity. The Bellman backup is still a γ\gamma-contraction in the sup norm, so the growth comes from the interpolation step: on these iterates it multiplies sup-norm distances by at least 1.049/0.95≈1.101.049/0.95 \approx 1.10, so it is not a nonexpansion, and PL\Proj\Bellman is not a contraction. A two-state example isolates the mechanism, and averagers are the fits that are always sup-norm nonexpansions.

A Two-State Control Problem Where Least-Squares Value Iteration Diverges

The following problem is small enough to solve by hand and shows the same failure with the maximum active. It extends an example of Tsitsiklis & Van Roy (1996). There are two states, and in each the agent chooses between two actions: move to state 1 or move to state 2. All rewards are zero, so v∗=0v^* = 0 whatever the policy. The value function is represented with a single feature, v(1;θ)=θv(1;\theta) = \theta and v(2;θ)=2θv(2;\theta) = 2\theta, which contains v∗v^* at θ=0\theta = 0. Function iteration computes the targets at both states and fits them by least squares with equal weights. Both states have the same two successors, so both targets equal

(Lvk)(s)=γmax⁡{v(1;θk), v(2;θk)}=γmax⁡{θk, 2θk},s=1,2.(\Bellman v_k)(s) = \gamma \max\{v(1;\theta_k),\, v(2;\theta_k)\} = \gamma\max\{\theta_k,\, 2\theta_k\}, \qquad s = 1, 2.

The maximum is active: when θk>0\theta_k > 0 the greedy action in both states moves to state 2, and when θk<0\theta_k < 0 it moves to state 1. The fit minimizes (θ−yk)2+(2θ−yk)2(\theta - y_k)^2 + (2\theta - y_k)^2 for the common target yky_k, so θk+1=3yk/5\theta_{k+1} = 3y_k/5, and

θk+1={6γ5 θkif θk>0,3γ5 θkif θk≤0.\theta_{k+1} = \begin{cases} \dfrac{6\gamma}{5}\,\theta_k & \text{if } \theta_k > 0, \\[2ex] \dfrac{3\gamma}{5}\,\theta_k & \text{if } \theta_k \leq 0. \end{cases}
import numpy as np

phi = np.array([1.0, 2.0])          # v(1; theta) = theta, v(2; theta) = 2 theta
gamma = 0.9

def backup(theta):
    v = phi * theta
    # both states can move to state 1 or to state 2, with zero reward
    return gamma * np.full(2, v.max())

def fit(targets):
    return phi @ targets / (phi @ phi)  # least squares, equal weights

for theta0 in (1.0, -1.0):
    theta = theta0
    path = [theta]
    for _ in range(40):
        theta = fit(backup(theta))
        path.append(theta)
    print(f"theta_0 = {theta0:+.0f}:  theta_10 = {path[10]:+.3g},  theta_40 = {path[40]:+.3g}")
theta_0 = +1:  theta_10 = +2.16,  theta_40 = +21.7
theta_0 = -1:  theta_10 = -0.00211,  theta_40 = -1.98e-11

For γ>5/6\gamma > 5/6 the iterates diverge from every θ0>0\theta_0 > 0; with γ=0.9\gamma = 0.9 they grow by 8% per iteration, while from θ0<0\theta_0 < 0 they converge to zero. On the diverging branch the Bellman operator multiplies the sup-norm distance between vkv_k and v∗v^* by γ\gamma, and the fit then multiplies it by 6/56/5, so the fit is not a nonexpansion: the target is the constant 2γθk2\gamma\theta_k, and the best line through the origin overshoots it at state 2, where it predicts 125γθk\frac{12}{5}\gamma\theta_k. The fit error grows in proportion to θk\theta_k, so no bound that assumes a fixed accuracy per iteration can help here. Boyan & Moore (1995) observed the same failure with polynomial regression and neural networks on small control problems, at a time when TD-Gammon had made neural value functions look easy.

On that branch the greedy policy π\pi always moves to state 2, and Lvk=Lπvk\Bellman v_k = \BellmanPi v_k. The iteration is then the projected evaluation of π\pi, which is the original example of Tsitsiklis & Van Roy (1996): one action per state, state 1 moves to state 2 and state 2 stays put. With a single action the maximum is trivial and the optimality operator is the evaluation operator, so that one-action problem is already an instance of value iteration with the optimality operator, and one instance is all a counterexample needs. The second action shows that the maximum does not prevent the divergence. The sections on policy evaluation below return to the chain of π\pi.

Averagers Preserve the Sup-Norm Contraction

The composition PL\Proj\Bellman keeps the sup-norm contraction of L\Bellman whenever P\Proj is a nonexpansion in the sup norm, since then ∥PLv−PLw∥∞≤∥Lv−Lw∥∞≤γ∥v−w∥∞\|\Proj\Bellman v - \Proj\Bellman w\|_\infty \leq \|\Bellman v - \Bellman w\|_\infty \leq \gamma\|v - w\|_\infty. The argument uses only the contraction, so it holds with the maximum in L\Bellman. Which fitting rules are sup-norm nonexpansions? The answer was found independently in computational economics Judd (1992)Judd (1996)McGrattan (1997)Santos & Vigo-Aguiar (1998), economic dynamics Stachurski (2009), and reinforcement learning Gordon (1995)Gordon (1999), and the communities arrived at the same condition under different names.

Definition and Convergence Theorem

Gordon (1995) introduced the term averager for such operators. The finite-state characterization follows because a linear map is monotone if and only if its matrix has nonnegative entries, and preserves constants if and only if its rows sum to one. An interpolation operator (Pf)(s)=∑jℓj(s)f(sj)(\Proj f)(s) = \sum_j \ell_j(s) f(s_j) with cardinal functions ℓj\ell_j is an averager if and only if, at every ss, the weights ℓj(s)\ell_j(s) are nonnegative and sum to one. For an interpolation scheme that reproduces constants, so that the weights already sum to one, this holds if and only if the Lebesgue constant is Λ=1\Lambda = 1, the condition of the finite-horizon chapter and the property that separated the hat functions from the polynomial in the fishery.

Is an averager the same thing as collocation? In one direction, yes: collocation with a nodal basis whose cardinal functions are nonnegative and sum to one, such as the hat functions or multilinear interpolation on a grid, is an averager, and its P\Proj is a projection. The converse fails, because an averager need not reproduce its targets at the nodes. A kernel smoother (Pf)(s)=∑jk(s,sj)f(sj)/∑jk(s,sj)(\Proj f)(s) = \sum_j k(s, s_j) f(s_j) / \sum_j k(s, s_j) with a nonnegative kernel, or kk-nearest neighbors, assigns to a node a weighted average of the targets at nearby nodes, not the target at that node, so P2≠P\Proj^2 \neq \Proj. The averager condition therefore covers collocation with a monotone interpolant and also a class of smoothers that are not projections at all. What all of them share is that Pf\Proj f at every state is a convex combination of the values of ff, with weights that depend on the states and not on ff.

An averager acts like a weighted average: it respects order and is a nonexpansion in the sup norm. The converse fails: P=−I\Proj = -\mathbf{I} is a sup-norm nonexpansion but is not monotone. For a linear P\Proj that preserves constants, the two properties are equivalent, because a row that sums to one has absolute sum at most one if and only if its entries are nonnegative. The least-squares fit of the counterexample is not one. It maps the constant function (1,1)(1, 1) to (3/5,6/5)(3/5, 6/5), so it does not preserve constants, and it does not respect order either. Polynomial interpolation at Chebyshev nodes preserves constants but is not monotone: its cardinal functions dip below zero between the nodes, and its Lebesgue constant is about 2.4 for ten nodes. That is how the ten-coefficient polynomial of the fishery in Function Iteration Can Diverge could make PL\Proj\Bellman fail to be a contraction, while the hat functions, whose cardinal functions are nonnegative, could not.

Theorem 1 combines results from two literatures. Gordon (1995) defined averagers, in a slightly more general form in which fixed constants may enter the average, proved that every averager is a sup-norm nonexpansion and that function iteration with one therefore converges at rate γ\gamma, and bounded the error of the limit by 2γε/(1−γ)2\gamma\varepsilon/(1-\gamma), where ε\varepsilon is the distance from v∗v^* to the nearest fixed point of the averager. Santos & Vigo-Aguiar (1998) proved that value iteration with piecewise-linear interpolation on a triangulation, the averager used for growth models in economics, converges, with an error that goes to zero linearly in the mesh size. The bound in the form stated here, through ∥Pv∗−v∗∥∞\|\Proj v^* - v^*\|_\infty, follows from the same contraction argument, and the proof of Proposition 1 follows Stachurski (2009). The fixed-point error is the best-approximation error ∥Pv∗−v∗∥∞\|\Proj v^* - v^*\|_\infty multiplied by (1−γ)−1(1-\gamma)^{-1}. For an averager the per-iteration error stays bounded, which is the condition that the error bound for arbitrary fits, in the chapter on fitted value methods, requires.

The stochastic matrix gives the averaging a Markov-chain reading: Pv\Proj v is an expected value after one random transition, and expectations preserve order. The finite-horizon chapter made the same observation about linear interpolation, which replaces a deterministic successor by a random grid node with the interpolation weights as probabilities. Composing that chain with the model’s own transitions makes PL\Proj\Bellman the Bellman operator of a finite-state MDP, which is why it contracts.

Which Common Fits Are Averagers

The same condition appears under several names in the literature on continuous-state control, often without reference to Gordon. Kushner & Dupuis (2001) build their Markov chain approximations of controlled diffusions from interpolation weights that are transition probabilities, the Markov-chain reading above used as a design principle. Rust (1997) solves value iteration on NN uniformly drawn states, with the transition density at those states, normalized to sum to one, as the averaging weights. The random grid is an averager, and for a finite set of actions the number of draws needed for a given accuracy grows only polynomially with the dimension of the state. The kernel-based reinforcement learning of Ormoneit & Sen (2002) applies the same normalized-kernel averaging to sampled transitions, without a model, and proves consistency as the number of samples grows and the bandwidth shrinks. Munos & Moore (2002) refine a triangulation of the state space where the value function or the policy varies most, and interpolate within each simplex with barycentric weights, again an averager.

Which regressors are averagers? State aggregation, kk-nearest neighbors, kernel smoothing with nonnegative kernels normalized to sum to one, and multilinear interpolation on a grid all predict a convex combination of training targets whose weights depend only on the states. So does a regression tree, which predicts the average of the targets in a leaf, as long as its partition of the state space does not depend on the targets. Ernst et al. (2005) used this to give tree-based fitted Q-iteration a convergence guarantee. Their extremely randomized trees choose splits with the help of the targets, and freezing the tree structure after some iterations restores the guarantee. Linear least squares, high-order polynomial interpolation, and neural networks are not averagers. The table lists the common fits, with a paper that used each one for value functions.

MethodAverager?NotesUsed for value functions in
Piecewise linear interpolationYesBarycentric weights are nonnegative and sum to oneMunos & Moore (2002)
Multilinear interpolation (grid)YesWeights are products of one-dimensional hat functionsJohnson et al. (1993)
Variation-diminishing splines (Schoenberg)YesB-spline weights are nonnegative and sum to oneStachurski (2008)
Shape-preserving splines (Schumaker, rational Hermite)Not linearPreserve monotonicity and concavity of the data, not covered by the averager theoremCai & Judd (2012)
State aggregationYesEqual weights within a groupTsitsiklis & Van Roy (1996), Whitt (1978)
kk-nearest neighborsYesEqual weights within a neighborhoodShah & Xie (2018)
Kernel smoothing (nonnegative kernels)YesIf the weights are normalized to sum to oneOrmoneit & Sen (2002), Rust (1997)
Tile coding (CMAC)Depends on the fitAveraging the tilings’ separate fits is an averager; the joint least-squares fit is not in two or more dimensions (Tile Coding: Between Aggregation and Galerkin)Sutton (1996)
Regression trees and forests, fixed partitionYesLeaf averages; guarantee lost if splits depend on the targetsErnst et al. (2005)
High-order polynomial interpolationNoNegative weights (Runge phenomenon)Bellman et al. (1963)
Least squares on an arbitrary basisNoThe counterexample aboveTsitsiklis & Van Roy (1996)
Neural networksNoNo sign or normalization constraint on the fitTesauro (1995), Riedmiller (2005)

The table places the fits of the two chapters. Collocation with piecewise-linear interpolation is an averager, so the folk wisdom that linear interpolation is safe for value iteration is a theorem. Collocation with a high-order polynomial is not, and its convergence in the fishery, when it happened, was not guaranteed. Galerkin projection and least squares are not averagers. Tree ensembles sit on the boundary, as the eight-dimensional example of the next chapter shows, and networks are outside. The solver matters too: Newton’s method never iterates PL\Proj\Bellman, so it does not need the contraction, which is why the hybrid strategy of Step 4: Solve the nn Equations starts with a monotone, low-order fit and switches to Newton with the accurate one.

Averagers pay for their stability in accuracy. The error bound of Theorem 1 is the best-approximation error ∥Pv∗−v∗∥∞\|\Proj v^* - v^*\|_\infty, and an averager can only represent functions that are smooth on the scale of its weights. That error is the error of a local method, and in high dimension it decreases slowly with the number of nodes.

Tile Coding: Between Aggregation and Galerkin

Tile coding is the linear representation that Sutton (1996) used to make early reinforcement learning work, and it descends from the cerebellar model articulation controller (CMAC) of Albus (1975). It gets no simple yes or no in the averager column of the table above, and the figure below shows why.

Each row of the top panel of Figure 1 is one tiling: a grid that cuts [0,1][0, 1] into cells of width hh, called tiles. There are KK tilings, and tiling kk is shifted by an offset oko_k, so the rows are staggered. The vertical line is a state ss. It lies in exactly one tile of each row, shaded in orange. Each tile carries one weight, and the value at ss is the sum of the KK weights of the orange tiles. In vector form, the feature vector ϕ(s)\boldsymbol\phi(s) has one binary entry per tile, with exactly KK ones, and v(s;θ)=ϕ(s)⊤θv(s; \theta) = \boldsymbol\phi(s)^\top\theta.

For example, take K=2K = 2 tilings of width h=1/2h = 1/2, the second shifted by h/2=1/4h/2 = 1/4. The first tiling has two tiles, [0,1/2)[0, 1/2) and [1/2,1][1/2, 1], and the second has three, [0,1/4)[0, 1/4), [1/4,3/4)[1/4, 3/4) and [3/4,1][3/4, 1], so there are five features, one per tile, listed tiling by tiling. The state s=0.6s = 0.6 lies in the second tile of both tilings, and s′=0.8s' = 0.8 lies in the second tile of the first tiling and the third tile of the second, so

ϕ(0.6)=(0,1∣0,1,0)⊤,ϕ(0.8)=(0,1∣0,0,1)⊤,\boldsymbol\phi(0.6) = (0, 1 \mid 0, 1, 0)^\top, \qquad \boldsymbol\phi(0.8) = (0, 1 \mid 0, 0, 1)^\top,
v(0.6;θ)=θ1,2+θ2,2,v(0.8;θ)=θ1,2+θ2,3,v(0.6; \theta) = \theta_{1,2} + \theta_{2,2}, \qquad v(0.8; \theta) = \theta_{1,2} + \theta_{2,3},

where θk,j\theta_{k,j} is the weight of tile jj of tiling kk. The two states share one of their two tiles, so their values share the weight θ1,2\theta_{1,2}. The middle panel of the figure writes ϕ(s)\boldsymbol\phi(s) out in the same way, one group of boxes per tiling, and lists the KK weights that add up to v(s;θ)v(s; \theta) as ss moves.

Set K=1K = 1 with the slider and a single row remains: that is state aggregation, which sits in both columns of the two-norm table. With K>1K > 1 the tiles overlap, and whether the fit is an averager depends on how the weights are fitted. Two questions settle it, and the top and bottom panels of the figure answer them: which functions the features can represent, and how an update at one state changes the value at another.

Figure 1:Top: KK tilings of [0,1][0, 1] with tiles of width h=1/4h = 1/4, the tiles that contain ss (orange), and the fine cells where all the tilings agree. Middle: the feature vector ϕ(s)\boldsymbol\phi(s), one box per tile, grouped by tiling, and the KK weights whose sum is v(s;θ)v(s; \theta). Bottom: the fraction of tiles that ss shares with each s′s', against the hat (1−∣s−s′∣/h)+(1 - |s - s'|/h)_+. Drag ss or press play. With random offsets, play redraws the offsets again and again and averages the kernels.

What tile coding represents. Move ss inside one cell of the bottom row of the top panel, labeled “fine”: the orange tiles do not change. Two states in the same fine cell lie in the same tile of every tiling, so they have the same features, and every v(⋅ ;θ)v(\cdot\,; \theta) is constant on the fine cells. With offsets spaced h/Kh/K apart, the edges of the KK tilings interleave and the fine cells have width h/Kh/K. In one dimension the code below finds that the feature matrix has rank equal to the number of fine cells, so the span of the tile features is exactly the set of functions that are constant on the fine cells. In one dimension, then, KK tilings of width hh represent the same functions as one tiling of width h/Kh/K, with about the same number of weights: the text under the figure reports 16 fine cells and 19 weights for K=4K = 4. The saving appears in higher dimension. In dd dimensions there are about (K/h)d(K/h)^d fine cells when the offsets are spaced h/Kh/K apart in each coordinate, but only about K(1/h+1)dK(1/h + 1)^d weights, so tile coding resolves the fine grid with roughly Kd−1K^{d-1} times fewer parameters than a fine tiling would need. The price is that its span is now a strict subspace of the functions that are constant on the fine cells. For K=4K = 4 and h=1/4h = 1/4 in the plane, the code below finds 91 weights, a rank of 88, and 256 fine cells.

How tile coding generalizes. The bottom panel answers the second question. Sutton used tile coding with incremental updates of the form θ←θ+αKϕ(s) (y−v(s;θ))\theta \leftarrow \theta + \frac{\alpha}{K}\boldsymbol\phi(s)\,(y - v(s; \theta)), which move each of the KK orange weights by the same amount. The value at any other state s′s' then changes by

v(s′;θnew)−v(s′;θ)=α κ(s,s′) (y−v(s;θ)),κ(s,s′)=ϕ(s)⊤ϕ(s′)K,v(s'; \theta_{\text{new}}) - v(s'; \theta) = \alpha\,\kappa(s, s')\,\big(y - v(s; \theta)\big), \qquad \kappa(s, s') = \frac{\boldsymbol\phi(s)^\top\boldsymbol\phi(s')}{K},

where κ(s,s′)\kappa(s, s') is the fraction of tiles that ss and s′s' share, the blue staircase in the bottom panel. The update at ss spreads to its neighbors in proportion to κ\kappa.

Compare the staircase with the dashed orange curve in the same panel. That curve is the hat function centered at ss,

(1−∣s−s′∣h)+=max⁡(0,  1−∣s−s′∣h),\Big(1 - \frac{|s - s'|}{h}\Big)_+ = \max\Big(0,\; 1 - \frac{|s - s'|}{h}\Big),

a triangle of height one and half-width hh: it equals 1 at s′=ss' = s, decreases linearly with the distance ∣s−s′∣|s - s'|, and is 0 once s′s' is a full tile width away from ss. It is the hat function of piecewise-linear interpolation, centered at ss, with the tile width as its half-width.

The top panel shows why the staircase follows the hat. A state s′s' shares the tile of row kk with ss unless an edge of row kk falls between them, so κ(s,s′)=1−(number of rows with an edge between s and s′)/K\kappa(s, s') = 1 - (\text{number of rows with an edge between } s \text{ and } s')/K. Each row has one edge every hh, so when δ=∣s−s′∣<h\delta = |s - s'| < h at most one edge of each row lies between the two states, and when δ≥h\delta \geq h every row has one. When the offsets are spaced h/Kh/K apart, the edges of the KK rows interleave evenly, one every h/Kh/K, so an interval of length δ<h\delta < h contains Kδ/hK\delta/h edges, rounded up or down. Hence κ(s,s′)\kappa(s, s') is 1−δ/h1 - \delta/h up to one step of 1/K1/K:

∣ κ(s,s′)−(1−∣s−s′∣h)+∣<1K.\Big|\,\kappa(s, s') - \Big(1 - \frac{|s - s'|}{h}\Big)_+\Big| < \frac{1}{K}.

The staircase therefore stays within one step of the hat, and the steps shrink as KK grows. Switch to random offsets and press play: for each draw the staircase is irregular, but a row with a random offset puts an edge between two states at distance δ\delta with probability min⁡(δ/h,1)\min(\delta/h, 1), so the expected fraction of shared tiles is exactly the hat, and the running average, in green, converges to it.

This answers the question of what kind of function approximator tile coding is. As a function of the displacement δ=s′−s\delta = s' - s, the hat is the box of width hh convolved with itself and divided by hh, which is the linear (degree-one) B-spline. The two questions of this subsection have different answers. What tile coding fits is piecewise constant: each feature is the indicator of one tile, a box, which is a degree-zero B-spline, and every tile is a union of fine cells, so every combination ϕ(s)⊤θ\boldsymbol\phi(s)^\top\theta is constant on each fine cell. How tile coding generalizes is piecewise linear: an update at ss changes the value at s′s' in proportion to κ(s,s′)\kappa(s, s'), which is the hat up to 1/K1/K, a degree-one B-spline. The CMAC literature drew the same conclusion and generalized it: Lane et al. (1992) replace the box receptive fields by B-splines of higher order, which makes the fitted function itself a smooth spline whose derivatives can be learned, and Brown & Harris (1994) treat the CMAC and B-spline networks as members of one family of lattice-based networks that are linear in their weights. Kernel methods reached tile coding from the other direction. The random binning features of Rahimi & Recht (2007) are tile coding with random offsets: they compute that two points fall in the same bin with probability given by the hat, and that drawing the tile width hh at random as well, with density h κ¨(h)h\,\ddot\kappa(h), turns the expected kernel into a kernel κ(∣s−s′∣)\kappa(|s - s'|) of the distance, for any κ\kappa whose second derivative is nonnegative, and into products of such kernels over the coordinates in several dimensions. The Laplacian kernel exp⁡(−∣s−s′∣)\exp(-|s - s'|), for example, comes from a tile width with a Gamma distribution. Because the expected fraction of shared tiles is a kernel, a linear fit on KK random tilings is kernel regression with that kernel estimated from KK random draws: tile coding with random offsets is a finite random-feature approximation of kernel regression.

Two dimensions and hashing. In the plane, each tiling is a grid of h×hh \times h squares, and Figure 2 shades κ(s,⋅)\kappa(s, \cdot) around a point ss, with the KK squares that contain ss outlined. With offsets spaced along the diagonal, every tiling moves along the line y=xy = x, and the shading is stretched along that line: states displaced along the diagonal share more tiles than states displaced across it. With random offsets drawn independently in each coordinate, the expected kernel is the product of one-dimensional hats, a tensor-product linear B-spline. The displacement (1,3)(1, 3) comes close to that symmetric shape with evenly spaced offsets, which is why Sutton & Barto (2018) recommend displacement vectors made of the first odd integers.

Figure 2:The shared-tile kernel κ(s,⋅)\kappa(s, \cdot) in the plane for KK tilings of h×hh \times h squares, h=1/4h = 1/4, with diagonal, asymmetric (1,3)(1, 3) or random offsets. The hash buttons send all the tiles into a table of 256, 64 or 16 weights, and the shading then shows the false similarity that collisions add far from ss. Drag the point or press play.

When K(1/h+1)dK(1/h + 1)^d weights are too many, tile coding implementations map the tiles into a table of MM weights with a hash function Sutton & Barto (2018). Press “64 weights” in the figure: speckles appear far from ss. Within one tiling, hashing only merges tiles into groups, so a hashed tiling is still a partition of the state space, into groups of cells that need not be adjacent. Across tilings, two tiles of different tilings can share a weight, and two distant states then share weights by accident. For a hash that sends each tile to a bucket uniformly and independently, the expected inner product of the hashed features is the number of shared tiles plus (K2−shared)/M(K^2 - \text{shared})/M, a bias toward false similarity that grows as the table shrinks. Feature hashing in machine learning Weinberger et al. (2009) removes this bias by multiplying each hashed feature by a random sign. The inner product is then unbiased, but the features are no longer nonnegative.

Where tile coding sits. The answer depends on how the weights are fitted, and the three common ways give three different operators.

  1. Fit each tiling separately and average. Each tiling alone is aggregation, whose projection Pk\Proj_k is a stochastic matrix. The average Pˉ=1K∑kPk\bar\Proj = \frac{1}{K}\sum_k \Proj_k is a convex combination of stochastic matrices, hence stochastic, so it is an averager and Theorem 1 applies. With uniform weighting and away from the boundary, row ss of Pˉ\bar\Proj is κ(s,⋅)/∑s′κ(s,s′)\kappa(s, \cdot) / \sum_{s'}\kappa(s, s'), so this fit is the kernel smoother of the table, with the staircase of Figure 1 as its kernel. It is not a projection, since Pˉ2≠Pˉ\bar\Proj^2 \neq \bar\Proj. A hashed tiling is still a partition, so hashing within each tiling keeps this fit an averager; a signed hash does not.

  2. Fit all the weights jointly by least squares. This is the Galerkin projection onto the span of the tile features. In one dimension, with every fine cell weighted, the span is that of the fine tiling, so the projection is aggregation onto the fine cells and is again an averager. In two dimensions it is not: for K=4K = 4 and h=1/4h = 1/4, the projection has negative entries and its sup-norm operator norm exceeds 4. The averager condition needs nonnegative entries, so it fails, and only the ξ\xi-norm results of the next subsection remain.

  3. Fit the weights incrementally by TD, as Sutton did. The sample-based update is a stochastic approximation of the joint fit, and its limit is the solution of the projected Bellman equation with the Galerkin projection of item 2. Each step spreads the correction with the nonnegative kernel κ\kappa, but this does not make the fixed point an averager. On-policy, the convergence result of Tsitsiklis & Van Roy (1997) applies, as it does to any linear features.

Source
import sys
from pathlib import Path

sys.path.insert(0, str(Path.cwd() / "code"))
import tile_coding as tc

z = lambda x: 0.0 if abs(x) < 1e-9 else x

k = tc.kernel_report_1d(m=8, h=0.25)
print("Shared-tile kernel, K = 8, h = 0.25")
for key, val in k.items():
    print(f"  {key:<42}{val:8.4f}")

a = tc.kernel_2d_anisotropy(m=8, h=0.25, r=0.1)
print("\nTwo dimensions, shared fraction at distance 0.1")
for key, (along, across) in a.items():
    print(f"  {key:<20} along the diagonal {along:.3f}, across it {across:.3f}")

print("\nProjections (K = 4, h = 0.25, uniform weighting on a grid of states)")
print(f"  {'':<4}{'states':>7}{'weights':>8}{'rank':>6}{'fine':>6}"
      f"{'joint min':>11}{'joint sup':>10}{'avg min':>9}{'avg sup':>9}")
for d, n in ((1, 64), (2, 32)):
    r = tc.projection_report(m=4, h=0.25, n=n, d=d)
    print(f"  {d}D  {r['states']:>7}{r['weights']:>8}{r['rank']:>6}{r['fine cells']:>6}"
          f"{z(r['joint LS: min entry']):>11.3f}{r['joint LS: sup norm']:>10.3f}"
          f"{r['averaged: min entry']:>9.3f}{r['averaged: sup norm']:>9.3f}")
print(f"  averaged smoother vs normalized shared-tile kernel (interior rows): "
      f"{tc.smoother_matches_kernel():.1e}")

hs = tc.hashing_report(m=8, h=0.25, M=64)
print("\nHashing 8 tilings into M = 64 weights")
for key, val in hs.items():
    print(f"  {key:<42}{val:8.3f}")

curves = tc.learning_curves()
print("\nRMSE after 30 / 100 / 300 / 1000 / 3000 samples (K = 8, h = 0.2, alpha = 0.1)")
for name, c in curves.items():
    print(f"  {name:<36}" + "".join(f"{e:8.3f}" for e in c))
Shared-tile kernel, K = 8, h = 0.25
  uniform: max |k - hat|                      0.1236
  random (mean of 4000 draws): max |k - hat|  0.0054
  1/K                                         0.1250

Two dimensions, shared fraction at distance 0.1
  diagonal (1, 1)      along the diagonal 0.750, across it 0.375
  asymmetric (1, 3)    along the diagonal 0.500, across it 0.500

Projections (K = 4, h = 0.25, uniform weighting on a grid of states)
       states weights  rank  fine  joint min joint sup  avg min  avg sup
  1D       64      19    16    16      0.000     1.000    0.000    1.000
  2D     1024      91    88   256     -0.054     4.436    0.000    1.000
  averaged smoother vs normalized shared-tile kernel (interior rows): 6.9e-18

Hashing 8 tilings into M = 64 weights
  mean shared tiles                            3.417
  unsigned hash: mean inner product            4.363
  predicted shared + (K^2 - shared)/M          4.364
  signed hash: mean inner product              3.435

RMSE after 30 / 100 / 300 / 1000 / 3000 samples (K = 8, h = 0.2, alpha = 0.1)
  coarse, 1 tiling of width h            0.374   0.276   0.262   0.267   0.263
  fine, 1 tiling of width h/K            0.508   0.434   0.276   0.094   0.076
  tile coding, K tilings of width h      0.353   0.178   0.115   0.103   0.084

The first block confirms the staircase bound, 0.124<1/K=0.1250.124 < 1/K = 0.125, and shows the random-offset average within 0.006 of the hat after 4000 draws. In the plane, diagonal offsets let states share three quarters of their tiles along the diagonal but only three eighths across it, and the displacement (1,3)(1, 3) makes the two equal. In the projection table, the joint least-squares fit is an averager in one dimension (smallest entry 0, sup norm 1) and not in two (smallest entry -0.054, sup norm 4.44), while the averaged single-tiling fits are averagers in both and coincide with the normalized shared-tile kernel. The hashing block matches the collision bias (K2−shared)/M(K^2 - \text{shared})/M and shows the random sign removing it.

The last block is the reason tile coding was popular, and Figure 3 animates it. Three learners receive the same noisy samples of a function with a jump. One coarse tiling of width hh, in blue, generalizes broadly and learns fast, but its error stops at 0.26, the error of its best approximation. One fine tiling of width h/Kh/K, in purple, can represent the function well, but each sample teaches it about one narrow cell, so after 100 samples its error is still 0.43. Tile coding, in orange, generalizes like the coarse tiling, with error 0.18 after 100 samples, and represents like the fine one, with error 0.08 after 3000. Watch the shaded bumps: each is the change made by the last sample, a wide box for the coarse tiling, a narrow box for the fine one, and the staircase hat of Figure 1 for tile coding. Overlapping tilings buy fast generalization at fine resolution, and in several dimensions they also buy memory.

Figure 3:A coarse tiling, a fine tiling and KK tilings learn from the same stream of noisy samples of v(s)=sin⁡(2πs)+0.8 1[s>0.6]v(s) = \sin(2\pi s) + 0.8\,\mathbb{1}[s > 0.6], with step size α=0.1\alpha = 0.1. The shaded bump under each fit is the change made by the last sample, magnified eight times. Bottom: root-mean-square error against the number of samples.

Linear Policy Evaluation: Convergence in the Stationary-Distribution Norm

Least squares is not an averager, yet linear features fitted by least squares are the setting of temporal-difference learning and LSTD, which converge when they evaluate a fixed policy. The reason is a second norm in which a stability proof can be carried out. This section develops it for the case where it applies, a fixed policy and linear features, and ends with why it does not extend to the maximum. The neural algorithms of the chapters ahead are outside this case, but the classical convergence results for temporal-difference learning come from it.

One Projection Matrix for Every Weighted-Residual Method

The two-state counterexample is an instance of the projected Bellman equation (14) of the previous chapter, v=PLvv = \Proj\Bellman v. The Bellman operator in it is fixed by the problem; the projection P\Proj is chosen by the method. Both families of stability results, averagers and on-policy weighting, are conditions under which PL\Proj\Bellman remains a contraction. On a finite state space S={s1,…,sm}\mathcal{S} = \{s_1, \ldots, s_m\}, a function is a vector of Rm\mathbb{R}^m, the features are the columns of an m×nm \times n matrix Φ\boldsymbol\Phi with rows ϕ(s)⊤\boldsymbol\phi(s)^\top, and the nn test functions of Step 3 of the previous chapter are the columns of an m×nm \times n matrix Ψ\boldsymbol\Psi. With a weighting ξ\xi over the states and Ξ=diag(ξ)\boldsymbol\Xi = \text{diag}(\xi), the conditions Ψ⊤Ξ(Lvθ−vθ)=0\boldsymbol\Psi^\top \boldsymbol\Xi (\Bellman v_\theta - v_\theta) = \mathbf{0} with vθ=Φθv_\theta = \boldsymbol\Phi\theta say that vθ=PLvθv_\theta = \Proj\Bellman v_\theta, where

P=Φ (Ψ⊤ΞΦ)−1Ψ⊤Ξ.\Proj = \boldsymbol\Phi\,(\boldsymbol\Psi^\top \boldsymbol\Xi \boldsymbol\Phi)^{-1} \boldsymbol\Psi^\top \boldsymbol\Xi .

This matrix satisfies P2=P\Proj^2 = \Proj and returns every element of the span of the features unchanged, so it is a projection onto that span. What it discards is the part of a function that the tests do not see. The methods of the previous chapter differ only in Ψ\boldsymbol\Psi. Galerkin takes Ψ=Φ\boldsymbol\Psi = \boldsymbol\Phi, and P\Proj is the ξ\xi-orthogonal projection, the weighted least-squares fit. Collocation replaces the row vectors Ψ⊤Ξ\boldsymbol\Psi^\top\boldsymbol\Xi by the nn rows of the identity that select the nodes, so that P\Proj is interpolation through the nodes; for a nodal basis such as the hat functions, entry (s,sj)(s, s_j) of P\Proj is the cardinal function ϕj(s)\phi_j(s). Other tests give oblique projections. Bellman residual minimization, for instance, uses the tests Ψ=(I−γPπ)Φ\boldsymbol\Psi = (\mathbf{I} - \gamma\mathbf{P}_\pi)\boldsymbol\Phi, which depend on the operator Scherrer (2010). The counterexample above is Galerkin with uniform weights, and its projection is the matrix P=15(1224)\Proj = \frac{1}{5}\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix}.

Whether the iteration vk+1=PLvkv_{k+1} = \Proj\Bellman v_k converges is a question about norms. The composition PL\Proj\Bellman is a γ\gamma-contraction in a norm whenever L\Bellman is a γ\gamma-contraction in that norm and P\Proj is a nonexpansion in the same norm, since then ∥PLv−PLw∥≤∥Lv−Lw∥≤γ∥v−w∥\|\Proj\Bellman v - \Proj\Bellman w\| \leq \|\Bellman v - \Bellman w\| \leq \gamma\|v - w\|. Two norms make this argument work, and each gives one family of stability results.

The first is the sup norm, in which L\Bellman is a γ\gamma-contraction for every MDP, with or without the maximum. The sup-norm operator norm of a matrix is its largest absolute row sum. When the constant function is in the span of the features, as it is for hat functions, polynomials and aggregation, P1=1\Proj\mathbf{1} = \mathbf{1}, so every row of P\Proj sums to one. A row that sums to one has absolute sum at least one, with equality if and only if its entries are nonnegative, so P\Proj is a sup-norm nonexpansion if and only if all its entries are nonnegative. The projection is then a stochastic matrix. This is the averager condition of Averagers Preserve the Sup-Norm Contraction. For collocation it is a condition on the cardinal functions, which must be nonnegative, and it holds for hat functions and fails for polynomials. For Galerkin it is a condition on the entries of Φ(Φ⊤ΞΦ)−1Φ⊤Ξ\boldsymbol\Phi(\boldsymbol\Phi^\top\boldsymbol\Xi\boldsymbol\Phi)^{-1}\boldsymbol\Phi^\top\boldsymbol\Xi, which fails for the counterexample, whose projection maps (1,0)(1, 0) to (1/5,2/5)(1/5, 2/5) and (0,1)(0, 1) to (2/5,4/5)(2/5, 4/5). Its rows sum to 3/53/5 and 6/56/5, so its sup-norm operator norm is 6/56/5, the factor by which the fit multiplied the sup-norm distance to v∗v^* in the iteration above.

The second is the ξ\xi-weighted norm ∥v∥ξ=(∑sξ(s)v(s)2)1/2\|v\|_\xi = (\sum_s \xi(s) v(s)^2)^{1/2}, in which every Galerkin projection with weighting ξ\xi is nonexpansive, whatever the features, because it is an orthogonal projection for the inner product that defines the norm. The difficulty moves to the operator, because the Bellman operator need not contract in ∥⋅∥ξ\|\cdot\|_\xi. On-Policy Weighting Makes Projected Evaluation a Contraction shows that the evaluation operator Lπ\BellmanPi contracts when ξ\xi is the stationary distribution of the policy, and that the optimality operator does not.

Sup normξ\xi-weighted norm
ProjectionStochastic matrix (averager)ξ\xi-orthogonal (Galerkin)
FeaturesNonnegative cardinal functions, localAny
OperatorL\Bellman or Lπ\BellmanPiLπ\BellmanPi only
DataAny weightingξ\xi stationary for Pπ\mathbf{P}_\pi (on-policy)
Typical methodsCollocation with hats, aggregation, nearest neighbors, kernel averagingTD(0), TD(λ\lambda), LSTD
Main referencesGordon (1995), Tsitsiklis & Van Roy (1996)Tsitsiklis & Van Roy (1997), Bertsekas & Tsitsiklis (1996)

The two columns trade restrictions on the fit for restrictions on the problem. The sup-norm route accepts the maximum and any data distribution, and asks for fits that only average their targets. The ξ\xi-norm route accepts any linear features, and asks that the operator be the evaluation operator of the policy that generated the data. Neither covers deep reinforcement learning, where a network is fitted from off-policy data to targets that contain the maximum.

State aggregation sits in both columns. Its features are the indicators of nn groups of states, and the Galerkin projection with any weighting ξ\xi replaces each value by the ξ\xi-weighted average over its group, (Pv)(s)=∑s′∈G(s)ξ(s′)v(s′)/∑s′∈G(s)ξ(s′)(\Proj v)(s) = \sum_{s' \in G(s)} \xi(s') v(s') / \sum_{s' \in G(s)} \xi(s'), where G(s)G(s) is the group of ss. The entries are nonnegative and the rows sum to one, so this Galerkin projection is also an averager, for every weighting. This is why aggregation was among the first approximation schemes with convergence proofs for function iteration Whitt (1978)Tsitsiklis & Van Roy (1996), and why Van Roy (2006) could bound the loss of its greedy policy with the optimality operator in place.

On-Policy Weighting Makes Projected Evaluation a Contraction

The ξ\xi-norm route keeps the Galerkin projection, which is nonexpansive in ∥⋅∥ξ\|\cdot\|_\xi for any features, and asks when the Bellman operator contracts in the same norm. The counterexample shows which weighting works. The chain moves from state 1 to state 2 and stays there, so its stationary distribution puts all its mass on state 2. If the fit weights each state by that distribution, it minimizes (2θ−2γθk)2(2\theta - 2\gamma\theta_k)^2 alone, and θk+1=γθk\theta_{k+1} = \gamma\theta_k converges. The equal weighting was the problem: it gives the state that the process leaves at once the same weight as the state where it stays.

For policy evaluation this observation is a theorem, which Tsitsiklis & Van Roy (1997) proved to explain why TD(0) converges with linear features. With the notation of One Projection Matrix for Every Weighted-Residual Method, the ξ\xi-weighted inner product, the norm, and the Galerkin projection (Ψ=Φ\boldsymbol\Psi = \boldsymbol\Phi) are

⟨u,v⟩ξ=u⊤Ξv,∥v∥ξ=v⊤Ξv,P=Φ(Φ⊤ΞΦ)−1Φ⊤Ξ.\langle u, v \rangle_\xi = u^\top \boldsymbol{\Xi} v, \qquad \|v\|_\xi = \sqrt{v^\top \boldsymbol{\Xi} v}, \qquad \Proj = \boldsymbol{\Phi}(\boldsymbol{\Phi}^\top \boldsymbol{\Xi} \boldsymbol{\Phi})^{-1} \boldsymbol{\Phi}^\top \boldsymbol{\Xi}.

Fitted policy evaluation is vk+1=PLπvkv_{k+1} = \Proj\BellmanPi v_k with Lπv=rπ+γPπv\BellmanPi v = \mathbf{r}_\pi + \gamma\mathbf{P}_\pi v. In reinforcement learning the weighting is not a free choice: the states in the data are those the process visits, and if the chain under π\pi is ergodic their distribution approaches the stationary distribution ξ\xi with ξ⊤Pπ=ξ⊤\xi^\top\mathbf{P}_\pi = \xi^\top. Suppose the fit is weighted by this stationary distribution. We show that P\Proj is nonexpansive and Lπ\BellmanPi is a γ\gamma-contraction, both in ∥⋅∥ξ\|\cdot\|_\xi, so that

∥PLπv−PLπw∥ξ≤∥Lπv−Lπw∥ξ≤γ∥v−w∥ξ.\|\Proj \BellmanPi v - \Proj \BellmanPi w\|_\xi \leq \|\BellmanPi v - \BellmanPi w\|_\xi \leq \gamma \|v - w\|_\xi.

Throughout, ξ(s)>0\xi(s) > 0 for every state, so that ∥⋅∥ξ\|\cdot\|_\xi is a norm.

Orthogonal projection is nonexpansive. For any vector vv, the projection Pv=Φθ^\Proj v = \boldsymbol\Phi\hat\theta is the fit that minimizes ∥v−Φθ∥ξ2\|v - \boldsymbol\Phi\theta\|_\xi^2 over θ\theta. Setting the gradient with respect to θ\theta to zero gives the normal equations Φ⊤Ξ(v−Φθ^)=0\boldsymbol\Phi^\top\boldsymbol\Xi(v - \boldsymbol\Phi\hat\theta) = \mathbf{0}, whose solution is the matrix in (12). They say that the residual v−Pvv - \Proj v is ξ\xi-orthogonal to every column of Φ\boldsymbol\Phi, hence to every vector Φθ\boldsymbol\Phi\theta of their span, and in particular to Pv\Proj v itself: ⟨Pv,v−Pv⟩ξ=θ^⊤Φ⊤Ξ(v−Pv)=0\langle \Proj v, v - \Proj v\rangle_\xi = \hat\theta^\top\boldsymbol\Phi^\top\boldsymbol\Xi(v - \Proj v) = 0. Decompose v=Pv+(v−Pv)v = \Proj v + (v - \Proj v) and expand the square of its norm. The cross term is this inner product, so it vanishes, and

∥v∥ξ2=∥Pv∥ξ2+2⟨Pv,v−Pv⟩ξ+∥v−Pv∥ξ2=∥Pv∥ξ2+∥v−Pv∥ξ2≥∥Pv∥ξ2.\|v\|_\xi^2 = \|\Proj v\|_\xi^2 + 2\langle \Proj v, v - \Proj v\rangle_\xi + \|v - \Proj v\|_\xi^2 = \|\Proj v\|_\xi^2 + \|v - \Proj v\|_\xi^2 \geq \|\Proj v\|_\xi^2.

This is the Pythagorean theorem for the ξ\xi-weighted inner product. Since P\Proj is linear, applying it to v−wv - w gives ∥Pv−Pw∥ξ=∥P(v−w)∥ξ≤∥v−w∥ξ\|\Proj v - \Proj w\|_\xi = \|\Proj(v - w)\|_\xi \leq \|v - w\|_\xi, so P\Proj is a nonexpansion in ∥⋅∥ξ\|\cdot\|_\xi.

No sign condition on the entries of P\Proj was needed. The sup-norm argument fails for this projection, while the ξ\xi-norm argument does not depend on the signs of its entries.

Lπ\BellmanPi contracts in ∥⋅∥ξ\|\cdot\|_\xi. Since Lπv−Lπw=γPπ(v−w)\BellmanPi v - \BellmanPi w = \gamma \mathbf{P}_\pi (v - w), it suffices to show ∥Pπz∥ξ≤∥z∥ξ\|\mathbf{P}_\pi z\|_\xi \leq \|z\|_\xi for every zz.

Before reading on, try to show this yourself. Hint: what property of ξ\xi relates it to Pπ\mathbf{P}_\pi?

Fix a state ss. The row p(⋅∣s,π(s))p(\cdot|s,\pi(s)) of Pπ\mathbf{P}_\pi is a probability distribution over next states, so the ss-th component (Pπz)(s)=∑s′p(s′∣s,π(s))z(s′)(\mathbf{P}_\pi z)(s) = \sum_{s'} p(s'|s,\pi(s)) z(s') is an average of the values z(s′)z(s') with these probabilities as weights. Since x↦x2x \mapsto x^2 is convex, Jensen’s inequality with the same weights gives, for each ss separately,

[(Pπz)(s)]2=[∑s′p(s′∣s,π(s))z(s′)]2≤∑s′p(s′∣s,π(s))z(s′)2.\big[(\mathbf{P}_\pi z)(s)\big]^2 = \Big[\sum_{s'} p(s'|s,\pi(s)) z(s')\Big]^2 \leq \sum_{s'} p(s'|s,\pi(s)) z(s')^2 .

Multiply each of these inequalities by ξ(s)≥0\xi(s) \geq 0 and add them over ss. The left side becomes ∥Pπz∥ξ2\|\mathbf{P}_\pi z\|_\xi^2. On the right, exchange the two finite sums so that z(s′)2z(s')^2 is factored out. The inner sum that remains, ∑sξ(s)p(s′∣s,π(s))\sum_s \xi(s) p(s'|s,\pi(s)), is the s′s'-th entry of the row vector ξ⊤Pπ\xi^\top\mathbf{P}_\pi, and stationarity, ξ⊤Pπ=ξ⊤\xi^\top\mathbf{P}_\pi = \xi^\top, replaces it by ξ(s′)\xi(s'):

∥Pπz∥ξ2=∑sξ(s)[(Pπz)(s)]2≤∑sξ(s)∑s′p(s′∣s,π(s))z(s′)2(Jensen, state by state)=∑s′z(s′)2∑sξ(s)p(s′∣s,π(s))(exchange of sums)=∑s′ξ(s′)z(s′)2(ξ⊤Pπ=ξ⊤)=∥z∥ξ2.\begin{aligned} \|\mathbf{P}_\pi z\|_\xi^2 = \sum_s \xi(s) \big[(\mathbf{P}_\pi z)(s)\big]^2 &\leq \sum_s \xi(s) \sum_{s'} p(s'|s,\pi(s)) z(s')^2 && \text{(Jensen, state by state)} \\ &= \sum_{s'} z(s')^2 \sum_s \xi(s) p(s'|s,\pi(s)) && \text{(exchange of sums)} \\ &= \sum_{s'} \xi(s') z(s')^2 && (\xi^\top\mathbf{P}_\pi = \xi^\top) \\ &= \|z\|_\xi^2 . \end{aligned}

Stationarity is used only in the third line, and it is the only property of ξ\xi that the argument needs. Taking square roots, ∥Pπz∥ξ≤∥z∥ξ\|\mathbf{P}_\pi z\|_\xi \leq \|z\|_\xi, and with z=v−wz = v - w,

∥Lπv−Lπw∥ξ=γ∥Pπ(v−w)∥ξ≤γ∥v−w∥ξ,\|\BellmanPi v - \BellmanPi w\|_\xi = \gamma\|\mathbf{P}_\pi(v - w)\|_\xi \leq \gamma\|v - w\|_\xi ,

so Lπ\BellmanPi is a contraction with modulus γ\gamma in ∥⋅∥ξ\|\cdot\|_\xi.

The two inequalities chain. Applying the nonexpansion of P\Proj to the vectors Lπv\BellmanPi v and Lπw\BellmanPi w, then the contraction of Lπ\BellmanPi,

∥PLπv−PLπw∥ξ≤∥Lπv−Lπw∥ξ≤γ∥v−w∥ξ.\|\Proj\BellmanPi v - \Proj\BellmanPi w\|_\xi \leq \|\BellmanPi v - \BellmanPi w\|_\xi \leq \gamma\|v - w\|_\xi .

So PLπ\Proj\BellmanPi is a contraction with modulus γ\gamma in ∥⋅∥ξ\|\cdot\|_\xi, and by Theorem 3 fitted policy evaluation converges from any start to the unique solution of the projected Bellman equation

v=PLπv.v = \Proj \BellmanPi v.

Its solution is the fixed point to which TD(0) with linear features converges. The argument of Theorem 1 bounds its distance to vπv_\pi by (1−γ)−1∥Pvπ−vπ∥ξ(1-\gamma)^{-1}\|\Proj v_\pi - v_\pi\|_\xi, and the inner-product structure improves the constant to (1−γ2)−1/2(1-\gamma^2)^{-1/2} Tsitsiklis & Van Roy (1997).

Convergence came from matching the weighting to the operator, not from any property of the fit beyond orthogonality: ξ\xi must be the stationary distribution of the very Pπ\mathbf{P}_\pi that appears in Lπ\BellmanPi. When the data are collected by following π\pi, this holds automatically, which is on-policy learning. When they come from another behavior policy, as in the counterexample’s equal weighting, the Jensen step fails, Pπ\mathbf{P}_\pi need not be nonexpansive in ∥⋅∥ξ\|\cdot\|_\xi, and PLπ\Proj\BellmanPi may not contract. Baird’s counterexample Baird (1995) is the classical demonstration.

The Galerkin Linear System Is Positive Definite On-Policy

The projected Bellman equation (19) is the Galerkin method of the previous chapter, with the stationary distribution as weight. Its nn conditions Φ⊤Ξ(rπ+γPπΦθ−Φθ)=0\boldsymbol\Phi^\top\boldsymbol\Xi(\mathbf{r}_\pi + \gamma\mathbf{P}_\pi\boldsymbol\Phi\theta - \boldsymbol\Phi\theta) = \mathbf{0} form the linear system

Aθ=b,A=Φ⊤Ξ(I−γPπ)Φ,b=Φ⊤Ξ rπ.\mathbf{A}\theta = \mathbf{b}, \qquad \mathbf{A} = \boldsymbol\Phi^\top\boldsymbol\Xi(\mathbf{I} - \gamma\mathbf{P}_\pi)\boldsymbol\Phi, \qquad \mathbf{b} = \boldsymbol\Phi^\top\boldsymbol\Xi\,\mathbf{r}_\pi .

Fitted policy evaluation solves it by function iteration, θk+1=θk+(Φ⊤ΞΦ)−1(b−Aθk)\theta_{k+1} = \theta_k + (\boldsymbol\Phi^\top\boldsymbol\Xi\boldsymbol\Phi)^{-1}(\mathbf{b} - \mathbf{A}\theta_k), and the LSTD method of the next subsection solves it directly. Temporal-difference learning, TD(0), solves the same system from single sampled transitions; the next chapter treats it as one more case of replacing expectations by samples. Whatever the solver, the system has to be well posed, and on-policy the inequality that made PLπ\Proj\BellmanPi a contraction also makes A\mathbf{A} positive definite. This is the step at the center of the convergence proof of TD by Tsitsiklis & Van Roy (1997).

A matrix with x⊤Ax>0x^\top\mathbf{A}x > 0 for every x≠0x \neq 0 need not be symmetric, but each of its eigenvalues has a positive real part: if Au=λu\mathbf{A}u = \lambda u with u≠0u \neq 0, the real part of uˉ⊤Au=λ∥u∥2\bar u^\top\mathbf{A}u = \lambda\|u\|^2 is the quadratic form of the symmetric part of A\mathbf{A} at the real and imaginary parts of uu, which is positive. In particular A\mathbf{A} is invertible, so on-policy the Galerkin system has exactly one solution for any independent features.

When the weighting ξ\xi is not stationary for Pπ\mathbf{P}_\pi, which is the situation of evaluating one policy from the data of another, the Jensen step fails, and Proposition 2 fails with it. The projection is still orthogonal, but A\mathbf{A} can be singular or have eigenvalues in the left half plane, and the solution, when there is one, can be far from vπv_\pi: Kolter (2011) shows that its error can be arbitrarily large relative to ∥Pvπ−vπ∥ξ\|\Proj v_\pi - v_\pi\|_\xi, and describes a convex set of weightings, close to the behavior distribution, for which a bound of the on-policy form still holds. What off-policy weighting does to the sample-based solvers, and how importance sampling, gradient TD and emphatic TD repair it, is taken up in the next chapter.

Solving the Galerkin System Directly: LSTD

Function iteration on (20) needs many sweeps, but the system has only nn unknowns and can be solved directly. Written out, its conditions say that the residual Lπv−v\BellmanPi v - v is ξ\xi-orthogonal to every feature:

Φ⊤Ξ(rπ+γPπΦθ−Φθ)=0,that isΦ⊤Ξ(Φ−γPπΦ)θ=Φ⊤Ξrπ.\boldsymbol{\Phi}^\top \boldsymbol{\Xi} (\mathbf{r}_\pi + \gamma \mathbf{P}_\pi \boldsymbol{\Phi} \theta - \boldsymbol{\Phi} \theta) = \mathbf{0}, \qquad\text{that is}\qquad \boldsymbol{\Phi}^\top \boldsymbol{\Xi} (\boldsymbol{\Phi} - \gamma \mathbf{P}_\pi \boldsymbol{\Phi}) \theta = \boldsymbol{\Phi}^\top \boldsymbol{\Xi} \mathbf{r}_\pi.

Solving it is the LSTD (least-squares temporal difference) method of Bradtke & Barto (1996), and the system is the Galerkin counterpart of the collocation step (32). Temporal-difference learning with linear features, TD(0), converges to the same fixed point Tsitsiklis & Van Roy (1997), so TD and LSTD are two solvers of one Galerkin equation, the first by stochastic approximation and the second by solving the linear system. Neither was designed that way; the reading as projected equations is due to Bertsekas Bertsekas & Tsitsiklis (1996)Bertsekas (2011), and the Galerkin method itself is standard in computational economics Judd (1998). Because the system is linear in the unknown, A\mathbf{A} and b\mathbf{b} can also be estimated from sampled transitions, which the next chapter does. On a 3-state chain under a fixed policy, with Pπ=(0.70.20.10.30.40.30.10.30.6)\mathbf{P}_\pi = \begin{pmatrix} 0.7 & 0.2 & 0.1 \\ 0.3 & 0.4 & 0.3 \\ 0.1 & 0.3 & 0.6 \end{pmatrix}, rπ=(1,2,0)\mathbf{r}_\pi = (1, 2, 0), features ϕ(s)=(1,s)\phi(s) = (1, s) and uniform weights:

Source
import numpy as np

P_pi = np.array([[0.7, 0.2, 0.1], [0.3, 0.4, 0.3], [0.1, 0.3, 0.6]])
r_pi = np.array([1.0, 2.0, 0.0])
gamma = 0.9

# Feature matrix: phi_1(s) = 1, phi_2(s) = s
states = np.array([1, 2, 3])
Phi = np.column_stack([np.ones(3), states])

# Uniform weighting
xi = np.ones(3) / 3
Xi = np.diag(xi)

# LSTD matrices
A = Phi.T @ Xi @ (Phi - gamma * P_pi @ Phi)
b = Phi.T @ Xi @ r_pi

theta_lstd = np.linalg.solve(A, b)
v_lstd = Phi @ theta_lstd
v_exact = np.linalg.solve(np.eye(3) - gamma * P_pi, r_pi)

print(f"LSTD solution: theta = ({theta_lstd[0]:.4f}, {theta_lstd[1]:.4f})")
print(f"\n{'State':<8} {'Exact':<12} {'LSTD':<12} {'Error':<12}")
print("-" * 44)
for s in range(3):
    print(f"{s+1:<8} {v_exact[s]:<12.4f} {v_lstd[s]:<12.4f} {v_lstd[s] - v_exact[s]:<12.4f}")

# Verify orthogonality
residual = r_pi + gamma * P_pi @ v_lstd - v_lstd
print(f"\nGalerkin orthogonality: <residual, phi_1> = {np.sum(xi * residual * Phi[:,0]):.6f}")
LSTD solution: theta = (12.2772, -0.9901)

State    Exact        LSTD         Error       
--------------------------------------------
1        10.0207      11.2871      1.2664      
2        10.8717      10.2970      -0.5746     
3        8.3418       9.3069       0.9652      

Galerkin orthogonality: <residual, phi_1> = 0.000000

Comparing the Two Conditions on One Chain

The two families of results certify different projections. To see them side by side, the next cell takes the policy-evaluation chain of the third tab of Figure 3, discretizes it on 201 grid points, and adds a restart to a uniform state with probability 0.2 at each step (without it the chain never returns below s=0.64s = 0.64, and its stationary distribution ignores the low states). For six projections with n=6n = 6, it reports the sup-norm and ξ\xi-norm operator norms of P\Proj, with ξ\xi stationary, the smallest entry of P\Proj, the spectral radius of γPPπ\gamma\Proj\mathbf{P}_\pi, the smallest real part of an eigenvalue of A\mathbf{A} for the Galerkin methods, and the sup-norm error of the fixed point.

Source
import sys
from pathlib import Path

sys.path.insert(0, str(Path.cwd() / "code"))
import projection_stability as ps

rows = ps.chain_table(n=6)
cols = ("sup |P|", "xi |P|", "min entry", "rho(gamma P L)", "min Re eig A", "sup error")
print(f"{'projection':<34}" + "".join(f"{c:>15}" for c in cols))
for row in rows:
    print(f"{row['method']:<34}" + "".join(f"{row[c]:>15.3f}" for c in cols))
projection                                sup |P|         xi |P|      min entry rho(gamma P L)   min Re eig A      sup error
collocation, hats                           1.000          7.314         -0.000          0.900            nan          0.366
collocation, polynomial                     1.952          8.871         -0.348          0.900            nan          1.051
Galerkin, hats, uniform                     1.955          1.159         -0.022          0.900          0.019          0.133
Galerkin, hats, stationary                  2.410          1.000         -0.045          0.900          0.011          0.138
Galerkin, polynomial, stationary            4.442          1.000         -0.067          0.900          0.035          0.303
aggregation, uniform                        1.000          1.159          0.000          0.900          0.017          0.605

Two rows have sup-norm operator norm one: the averagers, collocation with hats and aggregation, whose smallest entry is zero. Two rows have ξ\xi-norm one: the Galerkin projections with the stationary weighting. Each certificate holds where the theory says it should, and nowhere else. The Galerkin projections have sup-norm operator norm above one, since their smallest entries are negative, and the averagers have ξ\xi-norm operator norm above one. The spectral radius is 0.9 in every row, so on this chain the iteration converges even for polynomial collocation, whose sup-norm operator norm is about 2. The certificates are sufficient conditions, not necessary ones. A norm above one signals a risk, and the spectral radius decides whether the iteration diverges; the fishery showed that the same polynomial can make it diverge on another problem. Every Galerkin row, including the one with uniform weights, has A\mathbf{A} with eigenvalues in the right half plane. The errors differ more than the stability does: Galerkin with hats is about three times more accurate than collocation with the same hats, and aggregation, the most stable fit, is the least accurate one.

Why the Maximum Breaks the Weighted Argument

The weighted argument does not extend to the optimality operator Lv=max⁡a[ra+γPav]\Bellman v = \max_a [\mathbf{r}_a + \gamma \mathbf{P}_a v], and the obstacle is the Jensen step. For the optimality operator we would need to bound [max⁡a∑s′p(s′∣s,a)z(s′)]2\big[\max_{a} \sum_{s'} p(s'|s,a) z(s')\big]^2, and a maximum of averages is not an average. Nor is there a single stationary distribution to match, since the greedy policy, and with it the state distribution, changes from iteration to iteration. The failure goes beyond the proof: Farias & Van Roy (2000) give examples in which the projected optimality equation v=PLvv = \Proj\Bellman v with a ξ\xi-weighted Galerkin projection has no solution at all, so that no algorithm can converge to one.

Optimal stopping is the exception that confirms the diagnosis. With a stopping reward gg and a continuation chain P\mathbf{P} that the decision does not affect, the operator is Lv=max⁡{g,r+γPv}\Bellman v = \max\{g, \mathbf{r} + \gamma\mathbf{P}v\}, the maximum taken state by state. A maximum with a fixed function is a nonexpansion, ∣max⁡{g,a}−max⁡{g,b}∣≤∣a−b∣|\max\{g, a\} - \max\{g, b\}| \leq |a - b|, so the Jensen step goes through with the stationary distribution of P\mathbf{P}, and PL\Proj\Bellman is a γ\gamma-contraction in ∥⋅∥ξ\|\cdot\|_\xi. Tsitsiklis & Van Roy (1999) use this to prove that a TD method with linear features converges for optimal stopping, with the pricing of high-dimensional financial derivatives as their application. The eight-dimensional problem of the next chapter (Example: A Stopping Problem in Eight Dimensions) has this structure: the coordinates move the same way whether the agent stops or not.

The table collects what this chapter proves or cites for function iteration vk+1=P Tvkv_{k+1} = \Proj\,\mathrm{T} v_k, by operator T\mathrm{T} and by fit. With an averager the weighting of the data plays no role.

OperatorAveragerLinear features, on-policy weightingLinear features, other weighting
Evaluation Lπ\BellmanPiSup-norm contraction, converges Gordon (1995)ξ\xi-norm contraction, converges Tsitsiklis & Van Roy (1997)No guarantee, can diverge Baird (1995)
Optimal stoppingSup-norm contraction, convergesξ\xi-norm contraction, converges Tsitsiklis & Van Roy (1999)No guarantee
Optimality L\BellmanSup-norm contraction, converges Gordon (1995)No guarantee, the projected equation may have no solution Farias & Van Roy (2000)No guarantee

A nonlinear fit such as a neural network is not covered by any column: the guarantees left to it are the error bounds that assume each fit is accurate.

Approximate Policy Iteration

In the exact setting, Newton’s method on the Bellman equation is policy iteration (Newton-Kantorovich and Policy Iteration): by the envelope theorem the Jacobian at vkv_k involves the transition matrix of the greedy policy πk\pi_k, and the Newton step solves the evaluation equation of πk\pi_k. The previous chapter showed the same for collocation, where the Newton step (32) is the evaluation equation of πk\pi_k imposed at the nodes and solved within the span of the basis. With an arbitrary parametric value function the pattern is the same, except that the evaluation is done within the function class by whatever means are available. The algorithm alternates approximate evaluation, finding θ\theta with v(⋅;θ)≈vπkv(\cdot;\theta) \approx v_{\pi_k}, and greedy improvement. This is approximate policy iteration. Its guarantee is an error bound rather than a contraction: if every evaluation is accurate to ε\varepsilon in the sup norm, the policies are eventually within 2γε/(1−γ)22\gamma\varepsilon/(1-\gamma)^2 of optimal Bertsekas & Tsitsiklis (1996). Unlike exact policy iteration, the sequence of policies need not improve monotonically, and it can cycle among a few policies. With the smooth Bellman operator, the Jacobian is γPπk\gamma\mathbf{P}_{\pi_k} for the softmax policy, with no ties to resolve (Smooth Policy Iteration Is Newton’s Method).

When the evaluation has no closed form, as with a neural network, the natural replacement is a few sweeps of fitted policy evaluation, q←PLπqq \leftarrow \Proj\BellmanPi q, which is what the critic of NFQCA does.

Convergence Results for the Optimality Equation Across Fields

Reinforcement learning came late to this question. Operations researchers, control theorists, numerical analysts and economists solved Bellman optimality equations on continuous state spaces long before fitted Q-iteration, and each community proved convergence results for approximate solutions. Read side by side, they agree on one point. The guarantees that hold with the maximum are sup-norm guarantees for monotone approximations, as in Averagers Preserve the Sup-Norm Contraction; the others are special cases, or error bounds that assume the approximation is accurate.

Discretized dynamic programs. The oldest results replace a continuous-state problem by one on a finite grid and ask whether the solution converges as the grid is refined. Fox (1973) gave conditions for convergence on compact state spaces, and Bertsekas (1975) proved convergence of discretized value functions and policies under Lipschitz-type continuity conditions. Whitt (1978) bounded the error of replacing a problem by a smaller one built on a partition of the states and actions: the value of the small problem, extended to the original states, is within (1−γ)−1K(1-\gamma)^{-1}K of v∗v^* in the sup norm, where KK measures how much the rewards and transitions vary within a cell. This is the bound of Theorem 1 for the averager that aggregation is. Chow & Tsitsiklis (1991) showed that refining the grid from coarse to fine, a one-way multigrid method, reaches a given accuracy with an amount of work that matches the complexity of the problem up to constants. For aggregation, Van Roy (2006) bounds the loss of the greedy policy by the variation of v∗v^* within each group, and Bertsekas (2011) points out that approximate policy iteration with aggregation evaluates each policy exactly on an aggregate MDP, so its policies do not oscillate.

Monotone schemes for Hamilton–Jacobi–Bellman equations. In continuous time the Bellman equation is a partial differential equation, and its finite-difference and semi-Lagrangian discretizations are again fixed-point equations with a maximum. The Markov chain approximation method of Kushner & Dupuis (2001) builds the discretization as a controlled Markov chain on the grid. Its transition probabilities are the weights of the scheme, nonnegative and summing to one, so the scheme is an averager by construction, and value iteration on it converges. Falcone (1987) analyzed a grid-based discrete-time approximation of a discounted deterministic control problem, in which the value at a node is computed by interpolating the current values at the successor point, and proved that it converges to the value function as the time step and the mesh go to zero. Barles & Souganidis (1991) gave the general principle: a scheme that is monotone, stable and consistent converges to the viscosity solution whenever the limiting equation satisfies a comparison principle. Their monotonicity is the monotonicity in the definition of an averager: the computed value at a node must not decrease when a neighboring value increases. Munos & Moore (2002) brought these variable-resolution triangulations into reinforcement learning.

Numerical dynamic programming in economics. Economists met the same question when solving growth and investment models Rust (1996). Santos & Vigo-Aguiar (1998) proved that value iteration with piecewise-linear interpolation converges and bounded its error in terms of the mesh size, a special case of Theorem 1. Stachurski (2008) extended the argument to any nonexpansive approximation on a continuous state space, which covers kernel averagers and variation-diminishing splines. On the Newton side, Santos & Rust (2004) proved that policy iteration with piecewise-linear interpolation converges quadratically under regularity conditions, and superlinearly under weaker ones. Projection methods with global bases, Chebyshev collocation and Galerkin Judd (1992), are accurate and fast when they work, and they come with no convergence guarantee for the iteration, which is the fishery’s experience. The response of this literature was shape preservation: interpolants that keep the monotonicity and concavity of the data Cai & Judd (2012). They are nonlinear in the data and not covered by the averager theorem, but they remove the oscillations that give polynomial interpolation a Lebesgue constant above one.

Policy evaluation and optimal stopping. The weighted route of Linear Policy Evaluation: Convergence in the Stationary-Distribution Norm gives a contraction for the evaluation operator of the policy whose stationary distribution weights the fit, and for optimal stopping Tsitsiklis & Van Roy (1999). It gives none for the general optimality operator, where the projected equation may have no solution Farias & Van Roy (2000).

ApproachCovers the maximum?AssumptionConclusion
Monotone discretization, averagersYesNonnegative weights that sum to oneContraction, unique fixed point, convergence as the grid is refined
Aggregation and partition boundsYesSmall variation of the data within each cellError bound (1−γ)−1K(1-\gamma)^{-1}K
Policy iteration on a monotone discretizationYesRegularity of the modelQuadratic or superlinear convergence
Global bases (Chebyshev, Galerkin)Only special casesPolicy evaluation on-policy, optimal stoppingNo general guarantee for the iteration
Error propagationYesEach fit accurateError bound, no convergence claim

Function iteration can therefore rely on two kinds of guarantee. A monotone fit inherits the contraction. Any other fit has only error bounds, which hold for any fit but assume that each fit is accurate; the chapter on fitted value methods states them for an arbitrary regressor.

Exercises

These exercises complement the shorter ones inside the sections and follow the order of the chapter.

Solution to Exercise 1
  1. Yes: weights 1/51/5 on the five nearest training states, zero elsewhere.

  2. Yes: the weights are positive and normalized to sum to one, and they depend only on the states.

  3. No. The prediction at ss is ∑iwi(s)yi\sum_i w_i(s) y_i with wi(s)=1m+(s−sˉ)(si−sˉ)/∑j(sj−sˉ)2w_i(s) = \tfrac1m + (s - \bar s)(s_i - \bar s)/\sum_j (s_j - \bar s)^2, which is negative for training states on the far side of the mean when ss is far from sˉ\bar s. The weights do sum to one, so constants are preserved, but monotonicity fails.

  4. Yes, from the iteration at which the splits are frozen: each prediction is the average of the targets in a fixed leaf.

  5. No. The prediction is not a fixed linear function of the targets at all, and nothing constrains its sign or normalization.

Solution to Exercise 2
  1. For j=1,…,mj = 1, \ldots, m: q←PLπkqq \leftarrow \Proj\mathrm{L}_{\pi_k} q, then πk+1\pi_{k+1} greedy for qq. With m=1m = 1 each sweep uses the operator of the policy that is greedy for the current values, which is fitted value iteration; m→∞m \to \infty is approximate policy iteration with fitted policy evaluation as the evaluation step.

  2. m=1m = 1: NFQCA is the fitted value iteration end of the range, with the maximization in the target done by the actor.

  3. Every fit adds an error, and for a nonlinear fit nothing guarantees that repeated fitted evaluation of a fixed policy converges; with off-policy data it can diverge, as the next chapter shows. Many sweeps on a policy that is about to change also spend computation on accuracy that the next improvement discards.

Summary and Outlook

Function iteration on the Bellman optimality equation, vk+1=PLvkv_{k+1} = \Proj\Bellman v_k, is value iteration with a fit after each backup, and the fit can make the composition fail to be a contraction. It did so on the fishery with ten Chebyshev coefficients, and on a two-state problem whose value function the features represent exactly. Fits that only average their targets cannot: grid interpolation with hat functions, aggregation, nearest neighbors, normalized kernels and fixed-partition trees keep the iteration a contraction, with the maximum and from any set of states. For policy evaluation with linear features, least squares weighted by the stationary distribution of the policy is also safe, and LSTD solves the resulting Galerkin system directly, but that argument breaks with the maximum. Newton’s method becomes approximate policy iteration. The older literatures on discretized dynamic programs, monotone schemes for Hamilton–Jacobi–Bellman equations and numerical dynamic programming in economics reach the same conclusion: with the maximum, the guarantees are for monotone approximations, and the rest are special cases or error bounds that assume each fit accurate.

Every result of this chapter assumed a known model, exact expectations and states chosen by the designer. Fitted value methods drops all three: the expectations become sample averages, the states become the data at hand, and action values remove the model from decision time. The fit, meanwhile, becomes any regressor, and its error is controlled by bounds that ask only that each fit be accurate.

References
  1. Tsitsiklis, J. N., & Van Roy, B. (1996). Feature-based methods for large scale dynamic programming. Machine Learning, 22(1–3), 59–94.
  2. Boyan, J. A., & Moore, A. W. (1995). Generalization in reinforcement learning: Safely approximating the value function. Advances in Neural Information Processing Systems 7, 369–376.
  3. Judd, K. L. (1992). Projection methods for solving aggregate growth models. Journal of Economic Theory, 58(2), 410–452.
  4. Judd, K. L. (1996). Approximation, perturbation, and projection methods in economic analysis. In H. M. Amman, D. A. Kendrick, & J. Rust (Eds.), Handbook of Computational Economics (Vol. 1, pp. 509–585). Elsevier.
  5. McGrattan, E. R. (1997). Application of Weighted Residual Methods to Dynamic Economic Models.
  6. Santos, M. S., & Vigo-Aguiar, J. (1998). Analysis of a numerical dynamic programming algorithm applied to economic models. Econometrica, 66(2), 409–426.
  7. Stachurski, J. (2009). Economic Dynamics: Theory and Computation. MIT Press.
  8. Gordon, G. J. (1995). Stable function approximation in dynamic programming. Proceedings of the Twelfth International Conference on International Conference on Machine Learning, 261–268.
  9. Gordon, G. J. (1999). Approximate Solutions to Markov Decision Problems [Phdthesis]. Carnegie Mellon University.
  10. Kushner, H. J., & Dupuis, P. (2001). Numerical Methods for Stochastic Control Problems in Continuous Time (2nd ed., Vol. 24). Springer.
  11. Rust, J. (1997). Using Randomization to Break the Curse of Dimensionality. Econometrica, 65(3), 487–516.
  12. Ormoneit, D., & Sen, Ś. (2002). Kernel-Based Reinforcement Learning. Machine Learning, 49(2/3), 161–178. 10.1023/a:1017928328829
  13. Munos, R., & Moore, A. (2002). Variable Resolution Discretization in Optimal Control. Machine Learning, 49(2–3), 291–323.
  14. Ernst, D., Geurts, P., & Wehenkel, L. (2005). Tree-Based Batch Mode Reinforcement Learning. Journal of Machine Learning Research, 6, 503–556.
  15. Johnson, S. A., Stedinger, J. R., Shoemaker, C. A., Li, Y., & Tejada-Guibert, J. A. (1993). Numerical Solution of Continuous-State Dynamic Programs Using Linear and Spline Interpolation. Operations Research, 41(3), 484–500.