Before we begin, let me just define a few terms:
- is the state at time .
- is the action performed at time .
- is the reward received at time .
- is the return, that is the sum of discounted rewards received from time onwards, defined as .
- is the value of a state when following a policy , that is the expected return when starting in state and following a policy , defined as .
- is the value of a state when performing and action and then following the policy , that is .
Before moving further, note a small algebraic tric for re-writing in terms of itself
We can use this in the definition of and get
The last equation is called the Bellman equation for and it shows a recursive relationship between the value of the current state and the possible next states. This in and of itself is not as interesting, but we’ll use it to derive a solution to finding the optimal policy.
Let us now define the optimal value function, that is the value function of the optimal policy (denoted ).
that is the optimal value of a state is the maximum over all possible policies. Going one step further, we also define the optimal action-value function as
It’s easy to see now that , that is the maximum value of a state is computed by performing the best possible action. We can use this further to arrive at a simplified Bellman equation as follows
Here we managed to do a small but important trick in the second last equation (marked with ). But let us first decompose what does actually mean. Because is the discounted sum of rewards, it is only defined in terms of a policy. But since we assume the policy to be stochastic, we need to take an expectation over all possible actions chosen by the policy, and the possible rewards.
This changes at the marked equation, because we are no longer referring to the policy , but rather to the value function , which is not stochastic. As a reuslt, the expectation in the second to last equation is simply over , because we still assume stochastic rewards.
- Equations for the value function and notation borrowed from Reinforcement Learning: An Introduction by Andrew Barto and Richard S. Sutton.
Share on Twitter and Facebook
Discussion of "Bellman Equation"
If you have any questions, feedback, or suggestions, please do share them in the comments! I'll try to answer each and every one. If something in the article wasn't clear don't be afraid to mention it. The goal of these articles is to be as informative as possible.
If you'd prefer to reach out to me via email, my address is loading ..