{'fraction_non_alphanumeric': 0.04608373007132813, 'fraction_numerical': 0.01926367687172797, 'mean_word_length': 4.254985754985755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Off-policy Learning with Eligibility Traces: A Survey

In the framework of Markov Decision Processes, off-policy learning, that is the problem of learning a linear approximation of the value function of some fixed policy from one trajectory possibly generated by some other policy. We briefly review on-policy learning algorithms of the literature (gradient-based and least-squares-based), adopting a unified algorithmic view. Then, we highlight a systematic approach for adapting them to off-policy learning with eligibility traces. This leads to some known algorithms - off-policy LSTD(\lambda), LSPE(\lambda), TD(\lambda), TDC/GQ(\lambda) - and suggests new extensions - off-policy FPKF(\lambda), BRM(\lambda), gBRM(\lambda), GTD2(\lambda). We describe a comprehensive algorithmic derivation of all algorithms in a recursive and memory-efficent form, discuss their known convergence properties and illustrate their relative empirical behavior on Garnet problems. Our experiments suggest that the most standard algorithms on and off-policy LSTD(\lambda)/LSPE(\lambda) - and TD(\lambda) if the feature space dimension is too large for a least-squares approach - perform the best.


Introduction
We consider the problem of learning a linear approximation of the value function of some fixed policy in a Markov Decision Process (MDP) framework, in the most general situation where learning must be done from a single trajectory possibly generated by some other policy, also known as off-policy learning. Given samples, well-known methods for estimating a value function are temporal difference (TD) learning and Monte Carlo (Sutton and Barto, 1998). TD learning with eligibility traces (Sutton and Barto, 1998), known as TD(λ), constitutes a nice bridge between both approaches, and by controlling the bias/variance trade-off (Kearns and Singh, 2000), their use can significantly speed up learning. When the value function is approximated through a linear architecture, the depth λ of the eligibility traces is also known to control the quality of approximation (Tsitsiklis and Van Roy, 1997). Overall, the use of these traces often plays an important practical role.
developped in Section 2. Value function approximators can be categorized depending on the cost function they minimize (based on bootstrapping, on a Bellman residual minimization or on a projected fixed point approach) and on how it is minimized (gradient-descentbased or linear least-squares). Most of these algorithms have been extended to take into account eligibility traces, in the on-policy case. Works on extending these approaches (based on eligibility traces) to off-policy learning are scarser. They are summarized in Table 2 (algorithms in black). The first motivation of this article is to argue that it is conceptually simple to extend all the algorithms of Table 1 so that they can be applied to the off-policy setting and use eligibility traces. If this allows rederiving existing algorithms (in black in Table 2), it also leads to new candidate algorithms (in red in Table 2). The second motivation of this work is to discuss the subtle differences between these intimatelyrelated algorithms, and to provide some comparative insights on their empirical behavior (a topic that has to our knowledge not been considered in the literature, even in the simplest on-policy and no-trace situation).
The rest of this article is organized as follows. Section 2 introduces the background of Markov Decision Processes, describes the state-of-the-art algorithms for learning without eligibility traces, and gives the fundamental idea to extend the methods to the off-policy situation with eligibility traces. Section 3 details this extension for the least-squares based approaches: the resulting algorithms are formalized, and we derive recursive and memoryefficient formula for their implementation (this allows online learning without loss of generality, all the more that half of these algorithms are recursive by their very definition), and we discuss their convergence properties. Section 4 does the same job for stochastic gradient based approaches, which offers a smaller computational cost (linear per update, instead of quadratic). Last but not least, Section 5 describes an empirical comparison and Section 6 concludes.

Background
We consider a Markov Decision Process (MDP), that is a tuple {S, A, P, R, γ} in which S is a finite state space identified with {1, 2, . . . , N }, A a finite action space, P ∈ P(S) S×A the set of transition probabilities, R ∈ R S×A the reward function and γ the discount factor. A mapping π ∈ P(A) S is called a policy. For any policy π, let P π be the corresponding stochastic transition matrix, and R π the vector of mean reward when following π, i.e., of components E a|π,s [R(s, a)]. The value V π (s) of state s for a policy π is the expected discounted cumulative reward starting in state s and then following the policy π: where E π denotes the expectation induced by policy π. The value function satisfies the (linear) Bellman equation: ∀s, V π (s) = E s ,a|s,π [R(s, a) + γV π (s )].
It can be rewritten as the fixed-point of the Bellman evaluation operator: V π = T π V π where for all V, T π V = R π + γP π V .
In this article, we are interested in learning an approximation of this value function V π under some constraints. First, we assume our approximation to be linearly parameterized: with θ ∈ R p being the parameter vector and φ(s) ∈ R p the feature vector in state s. Also, we want to estimate the value function V π (or equivalently the associated parameter θ) from a single finite trajectory generated using a possibly different behavioral policy π 0 . Let µ 0 be the stationary distribution of the stochastic matrix P 0 = P π 0 of the behavior policy π 0 (we assume it exists and is unique). Let D 0 be the diagonal matrix of which the elements are (µ 0 (s i )) 1≤i≤N . Let Φ be the matrix of feature vectors: The projection Π 0 onto the hypothesis space spanned by Φ with respect to the µ 0 -quadratic norm, which will be central for the understanding of the algorithms, has the following closed-form: If π 0 is different from π, it is called an off-policy setting. Notice that all algorithms considered in this paper use this Π 0 projection operator, that is the projection according to the observed data 1 .
Standard Algorithms for on-policy Learning without Traces. We now review existing on-policy linearly parameterized temporal difference learning algorithms (see Table 1). In this case, the behavior and target policies are the same, so we omit the subscript 0 for the policy (π) and the projection (Π). We assume that a trajectory (s 1 , a 1 , r 1 , s 2 , . . . , s i , a i , r i , s i+1 , . . . , s n , a n , r n , s n+1 ) sampled according to the policy π is available, and will explain how to compute the i th iterate for several algorithms. For all j ≤ i, let us introduce the empirical Bellman operator at step j: Projected fixed point approaches aim at finding the fixed-point of the operator being the composition of the projection onto the hypothesis space and of the Bellman operator. In other words, they search for the fixed-pointV θ = ΠTV θ , Π being the just introduced projection operator. Solving the following fixed-point problem: with a least-squares approach, corresponds to the Least-Squares Temporal Differences (LSTD) algorithm of Bradtke and Barto (1996). Recently, Sutton et al. (2009) proposed two algorithms reaching the same objective, Temporal Difference with gradient Correction (TDC) and Gradient Temporal Difference 2 (GTD2), by performing a stochastic gradient descent of the function θ → V θ − ΠTV θ 2 which is minimal (and equal to 0) whenV θ = ΠTV θ . A related approach consists in building a recursive algorithm that repeatedly mimicks the iterationV θ i ΠTV θ i−1 . In practice, we aim at minimizing Performing the minimization exactly through a least-squares method leads to the Least-Squares Policy Evaluation (LSPE) algorithm of Bertsekas and Ioffe (1996). If this minimization is approximated by a stochastic gradient descent, this leads to the classical Temporal Difference (TD) algorithm (Sutton and Barto, 1998).
1. It would certainly be interesting to consider the projection according to the stationary distribution of π, the (unobserved) target policy: this would reduce off-policy learning to on-policy learning. However, this would require reweighting samples according to the stationary distribution of the target policy π, which is unknown and probably as difficult to estimate as the value function itself. As far as we know, the only work to move in this direction is the off-policy approach of Kolter (2011): samples are weighted such that the projection operator composed with the Bellman operator is non-expansive (so, weaker than finding the projection of the stationary distribution, but offering some guarantees). In this article, we consider only the Π0 projection.
Bootstrapping approaches consist in treating value function approximation after seeing the i th transition as a supervised learning problem, by replacing the unobserved values V π (s j ) at states s j by some estimate computed from the trajectory until the transition (s j , s j+1 ), the best such estimate beingT jVθ j−1 . This amounts to minimizing the following function: (1) Choi and Van Roy (2006) proposed the Fixed-Point Kalman Filter (FPKF), a least-square variation of TD that minmizes exactly the function of Equation (1). If the minimization is approximated by a stochastic gradient descent, this gives -again -the classical TD algorithm (Sutton and Barto, 1998). Finally, residual approaches aim at minimizing the distance between the value function and its image through the Bellman operator, V − T V 2 µ 0 . Based on a trajectory, this suggests the following function to minimize which is a biased surrogate of the objective V − T V 2 µ 0 (for instance, see Antos et al. (2006)). This cost function has originally been proposed by Baird (1995) who minimized it using a stochastic gradient approach (this algorithm being referred here as gBRM for gradient-based Bellman Residual Minimization). Both the parametric Gaussian Process Temporal Differences (GPTD) algorithm of Engel (2005) and the linear Kalman Temporal Differences (KTD) algorithm of Geist and Pietquin (2010b) can be shown to minimize the above cost using a least-squares approach, and are thus the very same algorithm 2 , that we will refer to as BRM (for Bellman Residual Minimization) in the remaining of this paper.
To sum up, it thus appears that after the i th transition has been observed, the above mentioned algorithms behave according to the following pattern: either through a least-squares approach or a stochastic gradient descent. Each of the algorithms mentionned above is obtained by substituting θ i , θ i−1 , θ j−1 or ω for ξ.

Towards Off-policy Learning with Traces
It is now easy to preview, at least at a high level, how one may extend the previously described algorithms so that they can deal with eligibility traces and off-policy learning. The idea of eligibility traces amounts to looking for the fixed-point of the following variation of the Bellman operator (Bertsekas and Tsitsiklis, 1996) ∀V 2. This is only true in the linear case. GPTD and KTD were both introduced in a more general setting: GPTD is nonparametric and KTD is motivated by the goal of handling nonlinearities.
that makes a geometric average with parameter λ ∈ (0, 1) of the powers of the original Bellman operator T . Clearly, any fixed-point of T is a fixed-point of T λ and vice-versa. After some simple algebra, one can see that: This leads to the following well-known temporal difference-based expression in some state s where we recall that E π means that the expectation is done according to the target policy π, and where we δ ik (s) = E π r k + γV (s k+1 ) − V (s k ) s i = s is the expected temporaldifference (Sutton and Barto, 1998). With λ = 0, we recover the Bellman evaluation equation. With λ = 1, this is the definition of the value function as the expected and discounted cumulative reward: As before, we assume that we are given a trajectory (s 1 , a 1 , r 1 , s 2 , . . . , s j , a j , r j , s j+1 . . . , s n , a n , r n , s n+1 ), except now that it may be generated from some behaviour policy possibly different from the target policy π of which we want to estimate the value. We are going to describe how to compute the i th iterate for several algorithms. For any i ≤ k, unbiased estimates of the temporal difference terms δ ik (s k ) can be computed through importance sampling (Ripley, 1987). Indeed, for all s, a, let us introduce the following weight: ρ(s, a) = π(a|s) π 0 (a|s) .
In our trajectory context, for any j and k, write with the convention that if k < j, ρ k j = 1. With these notations, is an unbiased estimate of δ ik (s k ), from which we may build an estimateT λ j,i V of T λ V (s j ) (we will describe this very construction separately for the least-squares and the stochastic gradient as they slightly differ). Then, by replacing the empirical operatorT j in Equation (2) byT λ j,i , we get the general pattern for off-policy trace-based algorithms: either through a least-squares approach or a stochastic gradient descent after having instantiated ξ = θ i , θ i−1 , θ j−1 or ω. This process, including in particular the precise definition of the empirical operatorT λ j,i , will be further developped in the next two sections 3 . Since they are easier to derive, we begin by focusing on least-squares algorithms (right column of Table 2) in Section 3. Then, Section 4 focuses on stochastic gradient descent-based algorithms (left column of Table 2).

Least-squares-based extensions to eligibility traces and off-policy learning
In this section, we first consider the case of least-squares solving of the pattern described in Equation (4). At their i th step, the algorithms that we are about to describe will compute the parameter θ i by exactly solving the following problem: where we define the following empirical truncated approximation of T λ : Though different definitions of this operator may lead to practical implementations, note thatT λ j,i only uses samples seen before time i: this very feature -considered by all existing works in the literature -will enable us to derive recursive and low-memory algorithms.
Recall that a linear parameterization is chosen here,V ξ (s i ) = ξ T φ(s i ). We adopt the following notations: The generic cost function to be solved is therefore: Before deriving existing and new least-squares-based algorithms, as announced, some technical lemmata are required. The first lemma allows computing directly the inverse of a rank-one perturbated matrix.

Lemma 1 (Sherman-Morrison)
Assume that A is an invertible n × n matrix and that u, v ∈ R n are two vectors satisfying 1 + v T A −1 u = 0. Then: 3. Note that we let the empirical operatorT λ j,i depends on the index j of the sample (as before) but also on the step i of the algorithm. This will be particularly useful for the derivation of the recursive and memory-efficient least-squares based algorithms that we present in the next section. The next lemma is simply a rewriting of imbricated sums. However, it is quite important here as it will allow stepping from the operatorT λ j,i (operator which depends on future of s j ) -forward view of eligibility traces -to the recursion over parameters using eligibility traces (dependence on only past samples) -backward view of eligibility traces -(see (Sutton and Barto, 1998, Ch.7) for further discussion on backward/forward views).
Lemma 2 Let f ∈ R N×N and n ∈ N. We have: We are now ready to mechanically derive the off-policy algorithms LSTD(λ), LSPE(λ), FPKF(λ) and BRM(λ). This is what we do in the following subsections.

Off-policy LSTD(λ)
The off-policy LSTD(λ) algorithm corresponds to instantiating Problem (5) with ξ = θ i : This can be solved by zeroing the gradient respectively to ω: which, through Lemma 2, is equivalent to: Introducing the (importance based) eligibility vector z j : one obtains the following batch estimate: where where The core of the analysis of Yu (2010a) consists in showing that 1 i A i and 1 i b i defined in Equation (8) respectively converge to A and b almost surely. Through Equation (7), this implies the convergence of θ i to θ * .

Off-policy LSPE(λ)
The off-policy LSPE(λ) algorithm corresponds to the instantiation ξ = θ i−1 in Problem (5): This can be solved by zeroing the gradient respectively to ω: Lemma 2 can be used (recall the definition of the eligibility vector z j in Equation (6)): Define the matrix N i as follows: where the second equality follows from Lemma 1. Let A i and b i be defined as in the LSTD description in Equation (8). For clarity, we restate their definition along with their recursive writing: Then, it can be seen that the LSPE(λ) update is:
This algorithm, (briefly) mentioned by Yu (2010a), generalizes the LSPE(λ) algorithm of Bertsekas and Ioffe (1996) to off-policy learning. With respect to LSTD(λ), which com- (7)) at each iteration, LSPE(λ) is fundamentally recursive (as it is based on an iterated fixed-point search). Along with the almost sure convergence of 1 i A i and 1 i b i to A and b (defined in Equation (10)), it can be shown that iN i converges to N = (Φ T D 0 Φ) −1 (see for instance Nedić and Bertsekas (2003)) so that, asymptotically, LSPE(λ) behaves as: or using the defintion of Π 0 , A, b (Equation (10)) and T λ (Equation (3)): The behavior of this sequence depends on whether the spectral radius of Π 0 T λ is smaller than 1 or not. Thus, the analyses of Yu (2010a) and Nedić and Bertsekas (2003) (for the convergence of N i ) imply the following convergence result: under the assumptions required for the convergence of off-policy LSTD(λ), and the additional assumption that the operator Π 0 T λ has a spectral radius smaller than 1 (so that it is contracting), LSPE(λ) also converges almost surely to the fixed-point of the compound Π 0 T λ operator. There are two sufficient conditions that can ensure such a desired contraction property. The first one is when one considers on-policy learning, as Nedić and Bertsekas (2003) did when they derived the first convergence proof of (on-policy) LSPE(λ). When the behavior policy π 0 is different from the target policy π, a sufficient condition for contraction is that λ be close enough to 1; indeed, when λ tends to 1, the spectral radius of T λ tends to zero and can potentially balance an expansion of the projection Π 0 . In the off-policy case, when γ is sufficiently big, a small value of λ can make Π 0 T λ expansive (see Tsitsiklis and Van Roy (1997) for an example in the case λ = 0) and off-policy LSPE(λ) will then diverge. Eventually, Equations (9) and (12) show that when λ = 1, both LSTD(λ) and LSPE(λ) asymptotically coincide (as T 1 V does not depend on V ).

Off-policy FPKF(λ)
The off-policy FPKF(λ) algorithm corresponds to the instantiation ξ = θ j−1 in Problem (5): This can be solved by zeroing the gradient respectively to ω: where N i is the matrix introduced for LSPE(λ) in Equation (11). For clarity, we restate its definition here and its recursive writing: Using Lemma 2, one obtains: With respect to the previously described algorithms, the difficulty here is that on the right side there is a dependence with all the previous terms θ k−1 for 1 ≤ k ≤ i. Using the symmetry of the dot product ∆φ T j θ k−1 = θ T k−1 ∆φ j , it is possible to write a recursive algorithm by introducing the trace matrix Z j that integrates the subsequent values of θ k as follows: With this notation we obtain: Using Equation (13) and a few algebraic manipulations, we end up with: This is the parameter update as provided in Algorithm 3. It generalizes the FPKF algorithm of Choi and Van Roy (2006) that was originally only introduced without traces and in the on-policy case. As LSPE(λ), this algorithm is Algorithm 3: Off-policy FPKF(λ)

Initialization;
Initialize vector θ 0 and matrix N 0 ; Set z 0 = 0 and Z 0 = 0; fundamentally recursive. However, its overall behavior is quite different. As we discussed for LSPE(λ), iN i can be shown to tend asymptotically to N = (Φ T D 0 Φ) −1 and FPKF(λ) iterates eventually resemble: The term in brackets is a random component (that only depends on the last transition) and 1 i acts as a learning coefficient that asymptotically tends to 0. In other words, FPKF(λ) has a stochastic approximation flavour. In particular, one can see FPKF(0) as a stochastic approximation of LSPE(0). Indeed, asymptotically, FPKF(0) does the following update and one can notice that ρ i φ i r i and φ i ∆φ T i are samples of A and b to which A i and b i converge through LSPE(0). When λ > 0, the situation is less clear -up to the fact that since T 1 V does not depend on V , we expect FPKF to asymptotically behave like LSTD and LSPE when λ tends to 1.
Due to its much more involved form (notably the matrix trace Z j integrating the values of all the values θ k from the start), it does not seem easy to provide a guarantee for FPKF(λ), even in the on-policy case. To our knowledge, there does not exist any proof of convergence for stochastic approximation algorithms in the off-policy case with traces 5 , and a related result for FPKF(λ) thus seems difficult. Based on the above-mentioned relation between FPKF(0) and LSPE(0) and the experiments we have run (see Section 5), we conjecture that off-policy FPKF(λ) has the same asymptotic behavior as LSPE(λ). We leave the formal study of this algorithm for future work.
5. An analysis of TD(λ), with a simplifying assumption that forces the algorithm to stay bounded is given by Yu (2010a). An analysis of GQ(λ) is provided by Maei and Sutton (2010), with an assumption on the second moment of the traces, which does not hold in general (see Proposition 2 in (Yu, 2010a)). A full analysis of these algorithms thus remains to be done. See also Sections 4.1 and 4.2.

Off-policy BRM(λ)
The off-policy BRM(λ) algorithm corresponds to the instantiation ξ = ω in Problem (5): This yields the following batch estimate: whereÃ The transformation of this batch estimate into a recursive update rule is somewhat tedious (it involves three "trace" variables), and the details are deferred to Appendix A for clarity. The resulting BRM(λ) method is provided in Algorithm 4. Note that at each step, this algorithm involves the inversion of a 2×2 matrix (involving the 2×2 identity matrix I 2 ), inversion that admits a straightforward analytical solution. The computational complexity of an iteration of BRM(λ) is thus O(p 2 ) (as for the preceding least-squares-based algorithms). GPTD and KTD, which are close to BRM, have also been extended with some trace mechanism; however, GPTD(λ) (Engel, 2005) 6 , KTD(λ) (Geist and Pietquin, 2010a) and the just described BRM(λ) are different algorithms. Briefly, GPTD(λ) is very close to LSTD(λ) and KTD(λ) uses a different Bellman operator 7 . As BRM(λ) builds a linear system whose solution is updated recursively, it resembles LSTD(λ). However, the system it builds is different. The following theorem, proved in Appendix B, partially characterizes the behavior of BRM(λ) and its potential limit 8 .
Theorem 3 Assume that the stochastic matrix P 0 of the behavior policy is irreducible and has stationary distribution µ 0 . Further assume that there exists a coefficient β < 1 such that 6. Technically, GPTD(λ) is not exactly a generalization of GPTD as it does not reduce to it when λ = 0. It is rather a variation. 7. The corresponding loss is and with λ = 1 it providesT 1 j,i . 8. Our proof is similar to that of Proposition 4 in Bertsekas and Yu (2009b). The overall arguments are the following: Equation (15) implies that the traces can be truncated at some depth l, whose influence on the potential limit of the algorithm vanishes when l tends to ∞. For all l, the l-truncated version of the algorithm can easily be analyzed through the ergodic theorem for Markov chains. Making l tend to ∞ allows tying the convergence of the original arguments to that of the truncated version. Eventually, the formula for the limit of the truncated algorithm is computed and one derives the limit.
The assumption given by Equation (15) trivially holds in the on-policy case (in which ρ(s, a) = 1 for all (s, a)) and in the off-policy case when λγ is sufficiently small with respect to the mismatch between policies. Note in particular that this result implies the almost sure convergence of the GPTD/KTD algorithms in the on-policy and no-trace case, a question that was still open in the literature (see for instance the conclusion of Engel (2005)). The matrixP , which is in general not a stochastic matrix, can have a spectral radius bigger than 1; Equation (15) ensures that (λγ) 2P has a spectral radius smaller than β so that D and D are well defined. Removing assumption of Equation (15) does not seem easy, since by tuning λγ maliciously, one may force the spectral radius of (λγ) 2P to be as close to 1 as one may want, which would makeÃ andb diverge. Though the quantityÃ −1b may compensate for these divergences, our current proof technique cannot account for this situation and a related analysis constitutes possible future work. The fundamental idea behind the Bellman Residual approach is to address the computation of the fixed-point of T λ differently from the previous methods. Instead of computing the projected fixed-point as in Equation (9), one considers the following overdetermined system γP QΦ, and solves it in a least-squares sense, that is by computing θ * =Ā −1b withĀ = Ψ T Ψ andb = Ψ T QR. One of the motivations for this approach is that, as opposed to the matrix A of LSTD/LSPE/FPKF,Ā is invertible for all values of λ, and one can always guarantee a finite error bound with respect to the best projection (see Schoknecht (2002); Yu and Bertsekas (2008); Scherrer (2010)). If the goal of BRM(λ) is to computeĀ andb from samples, what it actually computes (Ã andb as characterized in Theorem 3) will in general be biased because the estimation is based on a single trajectory 9 . Such a bias adds an uncontrolled variance term toĀ andb (for instance, see Antos et al. (2006)); an interesting consequence is thatÃ is always non-singular 10 . More precisely, there are two sources of bias in the estimation: one results from the non Monte-carlo evaluation (the fact that λ < 1) and the other from the use of the correlated importance sampling factors (as soon as one considers off-policy learning). The interested reader may check that in the on-policy case, and when λ tends to 1,Ã andb coincide withĀ andb. However, in the strictly off-policy case, taking λ = 1 does not prevent the bias due to the correlated importance sampling factors. If we have argued that LSTD/LSPE/FPKF should asymptotically coincide when λ = 1, we see here that BRM should generally differ in an off-policy situation.

Stochastic gradient based extensions to eligibility traces and off-policy learning
We have just provided a systematic derivation of all least-squares-based algorithms for learning with eligibility traces in an off-policy manner. When the number of features p is very large, the O(p 2 ) complexity involved by a least-squares approach may be prohibitive. In such a situation, a natural alternative is to consider an approach based on a stochastic gradient descent of the objective function of interest (Bottou and Bousquet, 2011;Sutton et al., 2009;Maei and Sutton, 2010).
9. It is possible to remove the bias when λ = 0 by using double samples. However, in the case where λ > 0, the possibility to remove the bias seems much more difficult. 10.Ā is by construction positive definite, andÃ equalsĀ plus a positive term (the variance term), and is thus also positive definite.
In this section, we will describe a systematic derivation of stochastic gradient based algorithms for learning in an off-policy manner with eligibility traces. The principle followed is the same as for the least-squares-based approaches: we shall instantiate the algorithmic pattern of Equation (4) by choosing the value of ξ and update the parameter so as move towards the minimum of J(θ i , ξ) in Equation (4) using a stochastic gradient descent. To make the pattern of Equation (4) precise, we need to define the empirical approximate operator we use. We will consider the untruncatedT λ i,n operators (written in the followingŝ T λ i , with a slight abuse of notation): where n is the total length of the trajectory. It should be noted that algorithmic derivations will here be a little bit more involved than in the least-squares case. First, with the instantiation ξ = θ i , the pattern given in Equation (4) is actually a fixed-point problem onto which one cannot directly perform a stochastic gradient descent (this issue will be addressed in Section 4.2 through the introduction of an auxiliary objective function, following the approach originally proposed by Sutton et al. (2009)). A second difficulty is the following: the just introduced empirical operatorT λ i depends on all the trajectory after step i (on the future of the process), and is for this reason usually coined a forward view estimate. Though it would be possible, in principle, to implement a gradient descent based on this forward view, it would not be very memory nor time efficient. Thus, we will follow a usual trick of the literature by deriving recursive algorithms based on a backward view estimate that is equivalent to the forward view in expectation. To do so, we will repeatedly use the following identity that highlights the fact that the estimateT λ i V can be written as a forward recursion: Lemma 4 LetT λ i be the operator defined in Equation (16) and let V ∈ R S . We havê Proof Using notably the identity ρ j i = ρ i ρ j i+1 , we have: To sum up, the "recipe" that we are about to use to derive off-policy gradient learning algorithms based on eligibility traces will consist of the following steps: 1. write the empirical generic cost function (4) with the untruncated Bellman operator of Equation (16) 2. instantiate ξ and derive the gradient-based update rule (with some additional work for ξ = θ i , see Section 4.2); 3. turn the forward view into an equivalent (in expectation) backward view.
The next subsection details the precise derivation of the algorithms.

Off-policy TD(λ)
Because it is the simplest, we begin by considering the bootstrap approach, that is the instantiation ξ = θ j−1 . The cost function to be minimized is therefore: Minimized with a stochastic gradient descent, the related update rule is (α i being a standard learning rate and recalling thatV ω (s At this point, one could notice that the exact same update rule would have been obtained with the instantiation ξ = θ i−1 . This was to be expected: as only the last term of the sum is considered for the update, we have j = i, therefore ξ = θ i−1 = θ j−1 . Equation (17) makes use of a λ-TD error defined as For convenience, let also δ i be the standard (off-policy) TD error defined as The λ-TD error can be expressed as a forward recursion: Lemma 5 Let δ λ i be the λ-TD error and δ i be the standard TD error. Then for all ω, . Proof This is a corollary of Lemma 4: . Therefore, we get the following update rule The key idea here is to find some backward recursion such that in expectation, when the Markov chain has reached its steady state, it provides the same result as the forward recursion. Such a backward recursion is given by the following lemma.
Proposition 6 Let z i be the eligibility vector, defined by the following recursion: Proof For clarity, we omit the dependence with respect to ω and write below δ i (resp. δ λ i ) for δ i (ω) (resp. δ λ i (ω)). The result relies on successive applications of Lemma 5. We have: , as expectation is done according to the stationary distribution, therefore: This suggests to replace Equation (17) by the following update rule, which is equivalent in expectation when the Markov chain has reached its steady state. This is summarized in Algorithm 5.

Algorithm 5: Off-policy TD(λ)
Initialization; Initialize vector θ 0 ; Set z 0 = 0; This algorithm has first been proposed in the tabular case by Precup et al. (2000). An off-policy TD(λ) algorithm (with function approximation) has been proposed by Precup et al. (2001), but it differs significantly from the algorithm just described (notably it differs in the definition of the traces and the projected Bellman equation, and in the fact that it is constrained to episodic trajectories). Algorithm 5 has actually first been proposed much more recently by Bertsekas and Yu (2009a).
An important issue for the analysis of this algorithm is the fact that the trace z i may have an infinite variance, due to importance sampling (see Yu (2010b, Sec. 3.1)). As far as we know, the only existing analysis of off-policy TD(λ) (as provided in Algorithm 5) uses an additional contraint which forces the parameters to be bounded: after each parameter update, the resulting parameter vector is projected onto some predefined compact set. This analysis is performed by Yu (2010b, Sec. 4.1). Under the standard assumptions of stochastic approximations and most of the assumptions required for the on-policy TD(λ) algorithm, assuming moreover that Π 0 T λ is a contraction (which we recall to hold for a big enough λ) and that the predefined compact set used to project the parameter vector is a large enough ball containing the fixed point of Π 0 T λ , the constrained version of off-policy TD(λ) converges to this fixed-point (therefore, the same solution as off-policy LSTD(λ), LSPE(λ) and FPKF(λ)). We refer to Yu (2010b, Sec. 4.1) for further details. An analysis of the unconstrained version of off-policy TD(λ) described in Algorithm 5 is an interesting topic for future research.

Off-policy TDC(λ) and off-policy GTD2(λ)
In this section, the case ξ = θ i is considered. Following the general pattern, at step i, we would like to come up with a new parameter θ i that moves (from θ i−1 ) closer to the minimum of the function This problem is tricky since the function to minimize contains what we want to compute θ i -as a parameter. For this reason we cannot directly perform a stochastic gradient descent of the right hand side. Instead, we will consider an alternative (but equivalent) formulation of the projected fixed-point minimization θ = arg min ω V ω − Π 0 T λ V ω 2 , and will move from θ i−1 to θ i by making one step of gradient descent of an estimate of the function With the following vectorial notations: we consider the following objective function: This is the derivation followed by Sutton et al. (2009) in the case λ = 0 and by Maei and Sutton (2010) in the case λ > 0 (and off-policy learning). Let us introduce the following notation: Note that since we consider a linear approximation this quantity does not depend on θ.
Noticing that ∇δ λ j (θ) = φ j − g λ j , we can compute ∇J(θ): Let w i (θ) be a quasi-stationary estimate of the last part, that can be recognized as the solution of a least-squares problem (regression of λ-TD errors δ λ j on features φ j ): The identification with the above least-squares solution suggests to use the following stochastic gradient descent to form the quasi-stationary estimate: This update rule makes use of the λ-TD error, defined through a forward view. As for the previous algorithm, we can use Proposition 6 to obtain the following backward view update rule that is equivalent (in expectation when the Markov chain reaches its steady state): Using this quasi-stationary estimate, the gradient can be approximated as: Therefore, a stochastic gradient descent gives the following update rule for the parameter vector θ: Once again the forward view term δ λ i (θ i−1 )φ i can be turned into a backward view by using Proposition 6. There remains to work on the term g λ i φ T i . First, one can notice that the term g λ i satisfies a forward recursion.

Lemma 7 We have
Proof This result is simply obtained by applying the gradient to the forward recursion of T λ i V θ provided in Lemma 4 (according to θ). Using this, the term g λ i φ T i can be worked out similarly to the term δ λ i (θ i−1 )φ i .

Proposition 8 Let z i be the eligibility vector defined in Proposition 6. We have
Proof The proof is similar to that of Proposition 6. Writing b i = γρ i (1 − λ)φ i+1 and η i = γλρ i , we have Using this result and Proposition 6, it is natural to replace Equation (21) by an update based on a backward recursion: Last but not least, for the estimate w i to be indeed quasi-stationary, the learning rates should satisfy the following condition (in addition to the classical conditions): Eqs. (22) and (20) define the off-policy TDC(λ) algorithm, summarized in Algorithm 6. It was originally proposed by Maei and Sutton (2010) under the name GQ(λ). We call it off-policy TDC(λ) to highlight the fact that it is the extension of the original TDC algorithm of Sutton et al. (2009) to off-policy learning with traces. One can observe -to our knowledge, this was never mentionned in the literature before -that when λ = 1, the learning rule of TDC(1) reduces to that of TD(1). Maei and Sutton (2010) show that the algorithm converges with probability 1 to the same solution as the LSTD(λ) algorithm (that is, to θ * = A −1 b) under some technical assumptions. Contrary to off-policy TD(λ), this algorithm does not requires Π 0 T λ to be a contraction in order to be convergent. Unfortunately, one of the assumptions made in the analysis, requiring that the traces z i have uniformly bounded second moments, is restrictive since in an off-policy setting the traces z i may easily have an infinite variance (unless the behavior policy is really close to the target policy), as noted by Yu (2010a) (see also Randhawa and Juneja (2004)). A full proof of convergence thus still remains to be done.

Initialization;
Initialize vector θ 0 and w 0 ; Set z 0 = 0; Using the same principle (that is, performing a stochastic gradient descent to minimize J(θ)), in the λ = 0 case, an alternative to TDC, the GTD2 algorithm was derived by Sutton et al. (2009). As far as we know, it has never been extended to off-policy learning with traces; we do it now. Notice that, given the derivation of GQ(λ), obtaining this algorithm is pretty straightforward.
To do so, we can start back from Equation (19): This suggests the following alternative update rule (based on forward recursion): Using Proposition 8, it is natural to use the following alternative update rule, based on a backward recursion: The update of w i remains the same, and put together it gives off-policy GTD2(λ), summarized in Algorithm 7. The analysis of this new algorithm constitutes a potential topic for future research.

Off-policy gBRM(λ)
The last considered approach is the residual approach, corresponding to the instantiation ξ = ω. The cost function to be minimized is then: Following the negative of the gradient of the last term leads to the following update rule: recalling the notation g λ i = ∇T λ iV ω first defined in Equation (18). As usual, this update involves a forward view, which we are going to turn into a backward view. The term φ i δ λ i can be worked thanks to Proposition 6. The term g λ i δ λ i is more difficult to handle, as it is the product of two forward views (until now, we only considered the product of a forward view with a non-recursive term). This can be done thanks to the following original relation (the proof being somewhat tedious, it is deferred to Appendix C): we have that This result (together with Proposition 6) suggests to update parameters as follows: This gives the off-policy gBRM(λ) algorithm, depicted in Algorithm 8. One can observe that gBRM(1) is equivalent to TD(1) (and thus also TDC(1), cf. the comment before the description of Algorithm 6). The analysis of this new algorithm is left for future research.

Empirical Study
This section aims at empirically comparing the surveyed algorithms. As they only address the policy evaluation problem, we compare the algorithms in their ability to perform policy evaluation (no control, no policy optimization); however, they may straightforwardly be used in an approximate policy iteration approach (Bertsekas and Tsitsiklis, 1996;Munos, 2003)). In order to assess their quality, we consider finite problems where the exact value function can be computed.
More precisely, we consider Garnet problems (Archibald et al., 1995), which are a class of randomly constructed finite MDPs. They do not correspond to any specific application, but are totally abstract while remaining representative of the kind of MDP that might be encountered in practice. In our experiments, a Garnet is parameterized by 4 parameters and is written G(n S , n A , b, p): n S is the number of states, n A is the number of actions, b is a branching factor specifying how many possible next states are possible for each state-action pair (b states are chosen uniformly at random and transition probabilities are set by sampling uniform random b − 1 cut points between 0 and 1) and p is the number of features (for function approximation). The reward is state-dependent: for a given randomly generated Garnet problem, the reward for each state is uniformly sampled between 0 and 1. Features are chosen randomly: Φ is a n S × p feature matrix of which each component is randomly and uniformly sampled between 0 and 1, except the first row of which each component is set to 1 (this corresponds to a constant feature). The discount factor γ is set to 0.95 in all experiments.
We consider two types of problems, "small" and "big", respectively corresponding to instances G(30, 4, 2, 8) and G(100, 10, 3, 20). We also consider two types of learning: onpolicy learning and off-policy learning. In the on-policy setting, for each Garnet a policy π to be evaluated is randomly generated (by sampling randomly n A − 1 cut points between 0 and 1 for each state), and trajectories (to be used for learning) are sampled according to this same policy. In the off-policy setting, the policy π to be evaluated is randomly generated the same way, but trajectories are sampled according to a uniform policy π 0 (that chooses each action with equal probability, that is π 0 (a|s) = 1 n A for any state-action couple). For all algorithms, we choose θ 0 = 0. For least-squares-based algorithms (LSTD, LSPE, FPKF and BRM), we set the initial matrices (M 0 , N 0 , C 0 ) to 10 3 I (the higher this value, the more negligible its effect on estimates 11 ). We run a first set of experiments in order to set all other parameters (eligibility factor and learning rates). We use the following schedule for the learning rates: More precisely, we generate one problem (MDP and policy) for each possible combination small/big on-policy/off-policy (leading to four problems). For each problem, we generate 10 trajectories of length 10 4 using the behaviorial policy (which is the randomly generated target policy in the on-policy case and the uniform policy in the off-policy case), to be used by all algorithms. For each meta-parameter, we consider the following ranges of values: λ ∈ {0, 0.4, 0.7, 0.9, 1}, α 0 ∈ {10 −2 , 10 −1 , 10 0 }, α c ∈ {10 1 , 10 2 , 10 3 }, β 0 ∈ {10 −2 , 10 −1 , 10 0 } and β c ∈ {10 1 , 10 2 , 10 3 }. Then, we compute the parameter estimates considering all algorithms instantiated with each possible combination of the meta-parameters. This gives for each combination a family θ i,d with i the number of transitions encountered in the d th trajectory. Finally, for each problem and each algorithm, we choose the combination of meta-parameters which minimizes the average error on the second half of the learning curves (we do this to reduce the sensitivity to the initialization and the transient behavior). Formally, we pick the set of parameters that minimizes the following quantity: err = 1 10 10 d=1 1 5.10 3 10 4 i=5.10 3 11. We observed that this parameter did not play a crucial role in practice.
We provide the empirical results of this first set of experiments in Table 3 to 6. As a complement, we detail in Figure 1 the sensitivity of all algorithms with respect to the main parameter λ that controls the eligibility traces. We comment these results below.
2.75 LSPE 0.7 2.75 FPKF 1 2.77 BRM 0.9 2.77 TD 0.4 10 −1 10 3 3.95 gBRM 0.9 10 −1 10 3 4.45 TDC 0.9 10 −1 10 3 10 −1 10 3 6.31 GTD2 0.9 10 −2 10 3 10 −1 10 3 11.90 Table 4: Big problem (G (100, 10, 3, 20)), on-policy learning (π = π 0 ). Table 4 shows the best meta-parameters for 10 trajectories of a single instance of a big Garnet problem in an on-policy setting, as well as related performance. These results are consistent with those of the small problem, in the on-policy setting (with slightly different meta-parameters). The main difference are that GTD2 performs here the worse. Figure 1 (top, right) suggests that as the problem's size grows, the role of the eligibity factor gets more prominent: most algorithms need a relatively high value of λ to perform the best.  100, 10, 3, 20)). Top: on-policy learning (π = π 0 ), bottom: off-policy learning (π = π 0 ). Table 5 reports the best meta-parameters in an off-policy setting for a small problem. In terms of performance, Least-squares approaches are no longer equivalent. LSTD and LSPE get the best results, with the smallest possible value λ = 0: we believe that this choice is due to the fact that higher eligibility factor increases the variance due to importance sampling. FPKF and BRM need large values of λ to work well, and suffer much more from the off-policy aspect. Figure 1 (bottom, left) suggests that FPKF and BRM need a high value of λ (to "catch" the good performance of LSTD/LSPE) but then suffers from the variance due to importance sampling. Regarding gradient-based methods, TD's performance is good (it is close that of LSTD/LSPE), followed closely by GTD2 (both being better than FPKF/BRM). TDC and gBRM lead to the worse results; as both methods choose λ = 1, they here turn out to be equivalent to TD(1) (cf. the discussions after Algorithms 6 and 8) 12 . As for FPKF/BRM with respect to LSTD/LSPE, Figure 1 (bottom, left) further sug-λ α 0 α c β 0 β c err LSTD 0 4.99 LSPE 0 5.00 FPKF 0.9 12.61 BRM 1 13.17 TD 0.4 10 −1 10 2 7.65 gBRM 1 10 −2 10 2 24.04 TDC 1 10 −2 10 2 10 −2 10 1 24.04 GTD2 0.7 10 −1 10 3 10 −2 10 1 11.51 Table 5: Small problem (G (30, 4, 2, 8)), off-policy learning (π = π 0 ). gests that TDC and gBRM need a high value of λ in order to get a reasonable performance, but then suffer from the variance of importance sampling. Eventually, Table 6 shows the λ α 0 α c β 0 β c err LSTD 0 12.60 LSPE 0 12.62 FPKF 0.9 23.24 BRM 1 39.32 TD 0.4 10 −1 10 1 13.18 gBRM 0 10 −2 10 1 110.74 TDC 0.7 10 −2 10 3 10 −2 10 1 69.53 GTD2 1 10 −2 10 1 10 −1 10 3 23.97 Table 6: Big problem (G (100, 10, 3, 20)), off-policy learning (π = π 0 ). meta-parameters and performance in the most difficult situation: the off-policy setting of the big problem. These results are consistent with the off-policy results of the small problem, summarized in Table 5. LSTD and LSPE are the most efficient algorithms and choose the smallest possible value λ = 0. FPKF and BRM's performance deteriorate (significantly for the latter). TD behaves reasonably good (it is in particular much better than FPKF) and GTD2 follows closely. The performance of TDC and gBRM are the worse, the latter's by a significant amount. Figure 1 (bottom, right) is similar to that of the small problem. The main goal of the series of experiments we have just described was to choose reasonable values for the meta-parameters. We have also used these experiments to quickly comment the relative performance of the algorithms, but this is not statistically significant as this was based on a single (random) problem. Though we will see that the general behavior of the algorithm is globally consistent with what we have seen so far, the series of experiments that we are about to describe aims at providing such a statistically significant performance comparison. For each situation (small and big problems, on-and off-policy), we fix the meta-parameters to the previously reported values and we compare the algorithms on several new instances of the problems. These results are reported on Figures. 2 to 5. For each of the 4 problems, we randomly generate 100 instances (MDP and policy to be evaluated). For each such problem, we generate a trajectory of length 10 5 . Then, all algorithms learn using this very trajectory. On each figure, we report the average performance (left), measured as the difference between the true value function (computed from the model) and the currently estimated one, V π − Φθ 2 , as well as the associated standard deviation (right).  We begin by discussing the results in the on-policy setting. Figure 2 compares all algorithms for 100 randomly generated small problems (that is, each run corresponds to different dynamics, reward function, features and evaluated policy), the meta-parameters being those provided in Table 3. All least-squares approaches provide the best results and are bunched together; this was to be expected, as all algorithms use λ close to 1. In these problems, gBRM works better than other gradient-based methods, followed by TD and GTD2/TDC. Figure 3 compares the algorithms for 100 randomly generated big problems, the meta-parameters being those provided in Table 4. These result are similar to those of the small problem in an off-policy setting, except that TDC is now faster than GTD2, that TD is slightly faster than gBRM.  We now consider the off-policy setting. Figure 4 provides the average performance and standard deviation of the algorithms (meta-parameters being those of Table 5) on 100 small problems. Once again, we can see that LSTD/LSPE provide the best results. The two other least-squares methods (FPKF and BRM) are overtaken by the gradient-based TD algorithm. GTD2 is quite slow (slower than TD) and TDC/gBRM (that are identical to TD(1) since they both use λ = 1) are the slowest algorithms. Figure 5 provides the same data for the big problems (with the meta-parameters of Table 6). These results are similar to those of the small problems in an off-policy setting. The main differences are 1) that FPKF appears to converge faster than TD but with a bigger standard deviation, and 2) gBRM (that uses λ = 0) does not work anymore (it is here equivalent to the standard algorithm by (Baird, 1995) and probably suffers from the well-known associated bias issue).
Summary Overall, our experiments suggest that the two best algorithms are LSTD/LSPE, since they converge much faster in all situations. The gradient-based TD algorithm globally diplays a good behavior and constitutes a good alternative when the number p of features is too big for least-squares methods to be implemented. Though some new algorithms/extensions show interesting results (FPKF(λ) is consistently better that the stateof-the-art FPKF by Choi and Van Roy (2006), gBRM works well in the on-policy setting) most of the other algorithms do not seem to be empirically competitive with the trio LSTD/LSPE/TD, especially in off-policy situations. In particular, the algorithm introduced specifically for the off-policy setting (TDC/GTD2) are much slower than TD. Moreover, the condition required for the good behavior of LSPE, FPKF and TD -the contraction of Π 0 T λ -does not seem to be very restrictive in practice (at least for the Garnet problems we considered): though it is possible to build specific pathological examples where these algorithms diverge 13 , this never happened in our experiments.

Conclusion and Future Work
We have considered least-squares and gradient-based algorithms for value estimation in an MDP context. Starting from the on-policy case with no trace, we have recalled that several algorithms (LSTD, LSPE, FPKF and BRM for least-squares approaches, TD, gBRM and TDC/GTD2 for gradient-based approaches) fall in a common algorithmic pattern (Equation (2)). Substituting the original Bellman operator by an operator that deals with traces and off-policy samples naturally leads to the state-of-the-art off-policy trace-based versions of LSTD, LSPE, TD and TDC, and suggests natural extensions of FPKF, BRM, gBRM and GTD2. This way, we surveyed many known and new off-policy eligibility traces-based algorithms for policy evaluation.
We have explained how to derive recursive (memory and time-efficient) implementations of all these algorithms and discussed their known convergence properties (including an original analysis of BRM(λ) for sufficiently small λ, that implies the so far not known convergence of GPTD/KTD). Interestingly, it appears that the analysis of off-policy tracesbased stochastic gradient algorithms under mild assumptions is still an open problem: the only currently known analysis of TD (Yu, 2010a) only applies to a constrained version of the algorithm, and that of TDC (Maei and Sutton, 2010) relies on an assumption on the boundedness of the second moment traces that is restrictive (Yu, 2010a). Filling this theoretical gap, as well as providing complete analyses for the other gradient algorithms and FPFK(λ) and BRM(λ) constitute important future work.
Finally, we have illustrated and compared the behavior of these algorithms; this constitutes the first exhaustive empirical comparison of linear methods 14 . Overall, our study suggests that even if the use of eligibility traces generally improves the efficiency of all algorithms, LSTD and LSPE consistently provide the best estimates; and in situations where the computational cost is prohibitive for a least-squares approach (when the number p of features is large), TD probably constitutes the best alternative.

Appendix A. Derivation of the recursive formulae for BRM(λ)
We here detail the derivation of off-policy BRM(λ). We will need two technical lemmata. The first one is the Woodbury matrix identity which generalizes the Sherman-Morrison formula (given in Lemma 1).
Lemma 10 (Woodbury) Let A, U , C and V be matrices of correct sizes, then: The second lemma is a rewriting of imbricated sums: Lemma 11 Let f ∈ R N×N×N and n ∈ N. We have: As stated in Equation (14), we have the following batch estimate for BRM(λ): To obtain a recursive formula, these two sums have to be reworked through Lemma 11. Let us first focus on the latter: Writing we have that: With the following notations: and with the convention that z 0 = 0 and D 0 = 0, one can write: Similarly, on can show that: and I 2 the 2 × 2 identity matrix, we have: We can apply the Woodbury identity given in Lemma 10: The other sum can also be reworked: where 2 (l) also tends to 0. Then, it can be seen that: and, by a recurrence on i, one obtains where (l) tends to 0 when l tends to infinity. This implies that: In other words, one can see that lim i→∞Ã i i and lim l→∞ lim i→∞Ã i,l i are equal if the latter exists. In the remaing of the proof, we show that the latter limit indeed exists and we compute it explicitely.
Let us fix some l and let us consider the sequence (Ã i,l i ). At some index i, y i,l depends only on the last l samples, while D i,l depends on the same samples and the last l values of y j,l , thus on the last 2l samples. It is then natural to view the computation ofÃ i,l , which is based on y i,l , D i−1,l and ∆φ i = φ i − γρ i φ i+1 , as being related to a Markov chain of which the states are the 2l +1 consecutive states of the original chain (s i−2l , . . . , s i , s i+1 ). Write E 0 the expectation with respect to its stationary distribution. By the Markov chain Ergodic Theorem, we have with probability 1: Let us now explicitely compute this expectation. Write x i the indicator vector (of which the k th coordinate equals 1 when the state at time i is k and 0 otherwise). One has the following relations: φ i = Φ T x i . Let us first look at the left part of the above limit: (λγ) 2(2l−m) E 0 (X m,2l,2l − γX m,2l,2l+1 − γX m,2l+1,2l + γ 2 X m,2l+1,2l+1 ) Φ where we used the definitonρ k−1 j = (λγ) k−j ρ k−1 j and the notation X m,i,j = ρ i−1 m ρ j−1 m x i x T j . To finish the computation, we will mainly rely on the following Lemma: Lemma 12 (Some identities) LetP be the matrix of which the coordinates arep ss = a π(s, a)ρ(s, a)T (s, a, s ), which is in general not a stochastic matrix. Let µ 0 be the stationary distribution of the behavior policy π 0 . WriteD i = diag (P T ) i µ 0 . Then Proof We first observe that: To provide the identity, we will thus simply provide a proof by recurrence that E 0 [(ρ i−1 m ) 2 x i ] = (P T ) m−i µ 0 . For i = m, we have E 0 [x m ] = µ 0 . Now suppose the relation holds for i and let us prove it for i + 1. As this is true for all s , we deduce that E 0 [(ρ i ) 2 x i+1 |F i ] =P T x i and which concludes the proof by recurrence.
Let us consider the next identity. For i ≤ j, Eventually, the last identity is obtained by considering Y m,i,j = X T m,j,i .
Thus, coming back to our calculus, with D l = l−1 j=0 (λγ) 2jD j , and D l = Similarly, the second term on the right side of Equation (23) satisfies: with Q l = l−1 j=0 (λγP ) j . Gathering this and Equation (24), we see that the limit of When l tends to infinity, Q l tends to Q = (I − λγP ) −1 . The assumption of Equation (15) ensures that (λγ)P has spectral radius smaller than 1, and thus when l tends to infinity, D l tends to D = diag (I − (λγ) 2P T ) −1 µ 0 and D l to D = diag P T (I − (λγ) 2P T ) −1 µ 0 .
In other words, lim l→∞ lim i→∞Ã i,l i exists with probability 1 and equals: Eventually, this shows that lim i→∞Ã i i exists with probability 1 and shares the same value. A similar reasoning allows to show that lim i→∞b i i exists and equals Φ T (I − γP T )Q T D + λγ(DP − γD )Q R π .

Appendix C. Proof of Proposition 9
To prove Proposition 9, we need the following technical lemma.

Lemma 13
Forget the notations used so far. Let α i and β i be two forward recursions defined as Assume that for any function f we have that 15 Let also u i , v i and w i be the backward recursions defined as: Then, we have: Proof The proof looks like the one of Proposition 6, but is a little bit more complicated.
A key equality, to be applied repeatedly, is: Another equality to be used repeatedly makes use of the "stationarity" assumption. For any k ≥ 0 we have: These two identities can be used to work the term of interest: This process can be repeated, giving We have that w i = 1 + η 2 i−1 w i−1 = 1 + η 2 i−1 + (η i−1 η i−2 ) 2 + . . . , therefore: We can work on the first term: The work on the second term is symmetric: This finishes proving the result.
The proof of Proposition 9 is a simple application of the preceding technical lemma. By lemma 5, we have that By lemma 7, we have that The result is then a direct application of lemma 13.