For on-policy linear TD(0) with features ϕ, show that the expected update is α(b−Aw) and that the fixed point is wTD=A−1b, where A=E[ϕ(ϕ−γϕ′)⊤] and b=E[rϕ]. For the Markov reward process with P=(010.50.5), R=(0,1), γ=0.5 and a single feature ϕ=(1,0), what is wTD, and how does it compare with the best least-squares fit of the true values V=(0.8,1.6) under the stationary distribution?

Reinforcement learning, Function approximation
Level L5 Expert. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can derive the TD fixed point, interpret it as a projected Bellman equation, and see that it differs from the best approximation of Vπ.

Key idea

The TD(0) fixed point solves E[δ ϕ]=0, i.e. w=A−1b. It is the fixed point of the projected Bellman operator, Φw=Π Tπ(Φw). It is generally not the projection ΠVπ of the true values, although its error is within a factor 1/1−γ2 of the best one.

Steps

  1. The update is w←w+α δ ϕ with δ=r+γw⊤ϕ′−w⊤ϕ. Taking the expectation over the stationary distribution gives E[δϕ]=b−Aw with b=E[rϕ] and A=E[ϕ(ϕ−γϕ′)⊤].
  2. Set the mean update to zero: Aw=b, so wTD=A−1b. In matrix form A=Φ⊤D(I−γP)Φ and b=Φ⊤DR, where D=diag(d) and d is the stationary distribution.
  3. Stationary distribution of P: d1=0.5 d2 and d1+d2=1, so d=(1/3, 2/3).
  4. With ϕ=(1,0), only state 1 has a non-zero feature. A=d1×ϕ1(ϕ1−γ E[ϕ′∣s1])=13×1×(1−0.5×0)=13, because state 1 moves to state 2, whose feature is 0. And b=d1ϕ1R1=13×1×0=0.
  5. So wTD=b/A=0 and V^=(0,0). This is self-consistent. The model can say nothing about state 2, so it predicts V^(s2)=0, and then V^(s1)=0+γV^(s2)=0.
  6. Best least-squares fit: minimise d1(w−0.8)2+d2(0−1.6)2, which gives w=0.8 (V^=(0.8,0)). The weighted errors are ∥V^TD−V∥D=13(0.64)+23(2.56)=1.386 for TD, and 1.306 for the best fit.
  7. Check the bound ∥V^TD−V∥D≤11−γ2min⁡w∥Φw−V∥D=1.155×1.306=1.508. Since 1.386≤1.508, it holds.
  8. Convergence needs A to be positive definite. On-policy, ∥Pv∥D≤∥v∥D, so x⊤D(I−γP)x≥(1−γ)∥x∥D2>0. Off-policy, d is not stationary for P and this can fail, which is the source of the deadly triad.

Common mistakes

How long your answer should be

A page or more; 10 minutes.

Last checked on 4 December 2026.

Read this

Previous in Reinforcement learning: Prove the performance difference lemma: for two policies π and π′ with J(π)=Es0[Vπ(s0)], J(π′)−J(π)=11−γ Es∼dπ′, a∼π′[Aπ(s,a)], where dπ′(s)=(1−γ)∑t≥0γtP(st=s∣π′). What does it imply for policy improvement and for TRPO?
Next in Reinforcement learning: none