liveBook · Manning

Q-learning

As explained in Build a Robo-Advisor with Python (From Scratch)

Q-learning is a model-free reinforcement-learning algorithm that estimates the value of taking each action in each state and uses those estimates to derive a policy.

Q-learning estimates the value of each state-action pair and uses those estimates to derive an optimal policy. In goals-based financial planning, Q(W,t,a) evaluates an asset-allocation action at wealth W and time t. Unlike backward dynamic programming, it learns forward from t=0 by repeatedly running episodes and updating Q. section 6.2.2

The update combines current estimates with simulated experience:

  • Apply a learning rate α to the difference between the current Q value and the reward plus discounted best next-state Q value. section 6.2.2

Goals-based wealth planning

Initialize Q over wealth states, time points, and asset-allocation actions. Simulate the next wealth state, update the selected Q value, and repeat across 1,000,000 episodes to learn allocation values.

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Explains the state-action update and implements exploration, transitions, initialization, and episode generation.
Examples
Uses wealth states, time horizons, asset-allocation actions, simulated transitions, terminal goals, and repeated episodes.
What it assumes
Assumes a time-indexed wealth model with discrete states, actions, transitions, rewards, and a planning horizon.
What you can do after
Apply it via Python to estimate Q values and derive policies from simulated financial episodes.
How it connects
Connects reinforcement learning with value functions, policies, dynamic programming, asset allocation, and simulated state transitions.

Also explained in

Compare how 3 books explain Q-learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.