Four episodes are generated by a behaviour policy . For a target policy , the importance ratios and the returns are , , and . Compute the ordinary and weighted importance-sampling estimates of at the start state. Which is biased, and which has higher variance?
Reinforcement learning, On-policy and off-policy
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can apply the two importance-sampling estimators and explain the bias–variance difference between them.
Key idea
Ordinary IS averages over the episodes. Weighted IS divides by the sum of ratios, . Ordinary IS is unbiased but can have huge or even infinite variance. Weighted IS is biased (the bias goes to as grows) but has much lower variance.
Steps
- Explain the ratio. An episode that would produce more often than gets , and one that would never produce gets .
- Ordinary IS: .
- Weighted IS: .
- Sanity check. All observed returns lie between and , and weighted IS gives , inside that range because it is a weighted average of returns. Ordinary IS gives , which is larger than any return observed.
- Bias. With one episode, weighted IS equals exactly, which is the return of 's episode, not . So it is biased, but it is consistent, since the bias vanishes as .
- Variance. Ordinary IS multiplies returns by ratios that can be very large for long episodes, since is a product over time steps. Weighted IS normalises them, so each estimate stays within the range of returns.
Common mistakes
- Forgetting to divide by the sum of ratios in weighted IS.
- Dividing by the number of episodes with in ordinary IS. Ordinary IS divides by the total number of episodes.
- Claiming weighted IS is better in every case. It trades a small bias for a much lower variance, which is usually worth it.
How long your answer should be
Half a page; 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Reinforcement learning: A Markov reward process has two states with transition matrix , expected rewards and . What is the Bellman equation in matrix form, what is its solution for , and why does a unique solution exist for any ?
Next in Reinforcement learning: A tabular value function is for states A, B, C. One episode goes A B C end with rewards . Use TD() with accumulating traces, , and , and update every state at every step. What is after the episode? How does this differ from TD(0)?