A temporal-difference error measures the signed gap between a current value estimate and the discounted value estimated for the next period. A positive gap raises the current estimate; a negative gap lowers it. The learning rate controls how quickly Q responds. section 6.2.2
Updating Q in financial planning
For a wealth–time state and selected action, Q-learning samples the next wealth state, finds the maximum next-state action value, and updates the chosen Q value by alpha times the temporal-difference error. Repeated episodes refine estimates without transition probabilities.

