Bellman equation derivation: Difference between revisions

From Machinelearning
No edit summary
No edit summary
Line 37: Line 37:
Again, using the law of total probability while conditioning this time over states, we have
Again, using the law of total probability while conditioning this time over states, we have


:<math>\sum_a \pi(a\mid s) \sum_r r \Pr(R_{t+1}=r \mid A_t=a,S_t=s) = \sum_a \pi(a\mid s) \sum_r r \sum_{s'} \Pr(R_{t+1}=r \mid S_{t+1}=s',A_t=a,S_t=s)\Pr(S_{t+1}=s' \mid A_t=a,S_t=s)</math>
:<math>\begin{align}\sum_a \pi(a\mid s) \sum_r r \Pr(R_{t+1}=r \mid A_t=a,S_t=s) \\ &= \sum_a \pi(a\mid s) \sum_r r \sum_{s'} \Pr(R_{t+1}=r \mid S_{t+1}=s',A_t=a,S_t=s)\Pr(S_{t+1}=s' \mid A_t=a,S_t=s)\end{align}</math>

Revision as of 01:33, 1 September 2019

Bellman equation for .

We want to show for all states .

The core idea of the proof is to use the law of total probability to go from marginal to conditional probabilities, and then invoke the Markov assumption.

The law of total probability states that if is an event, and are events that partition the sample space, then .

For fixed event with non-zero probability, the mapping is another valid probability measure. In other words, define by for all events . Now the law of total probability for states that . We also have

So the law of total probability states that .

Now we see how the law of total probability interacts with conditional expectation. Let be a random variable. Then

Here the event is playing the role of in the statement of the conditional law of total probability.

This is the basic trick of the proof; we keep conditioning on different things (actions, next states, rewards) and using the law of total probability.

By definition, . Now rewrite and use the linearity of expectation to get . From here, we can work separately with and for a while.

Using the law of total probability while conditioning over actions, we have

Using the convention that , this becomes

Now we can reorder the sums to get

Again, using the law of total probability while conditioning this time over states, we have