liveBook · Manning

Environment

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

An environment is the external system in which a reinforcement-learning agent takes actions and from which it receives observations and rewards.

An environment is the external system an agent interacts with, producing feedback as rewards or penalties after actions. In financial planning, it is the stock and bond market surrounding an investor-agent. section 6.2

Model the environment through four connected elements:

  • State records relevant variables affecting decisions; the example uses wealth and discrete time. section 6.2
  • Action changes the state; the investor allocates a percentage of wealth to a stock fund or risk-free bond. section 6.2
  • Rewards and penalties shape future behavior, encouraging actions that improve cumulative reward and discouraging harmful ones. section 6.2

Goals-based investing

Represent possible wealth values across time with a funnel-shaped grid, using log wealth to accommodate widening dispersion as the investment horizon grows. section 6.2

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

How deep it goes
Models states with discretized wealth and time, including a log-wealth grid that reflects widening wealth dispersion.
Examples
Uses stock and bond markets, investor allocation, and a wealth-time grid for goals-based investing.
What you can do after
Evaluate/understand how to represent a financial environment with wealth states, time steps, investment actions, and reward feedback.
How it connects
Connects environment to agents, states, actions, rewards, penalties, and policies in reinforcement learning.

Also explained in

Compare how 8 books explain environment →

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.