Slow Progress On Agent-Based Models
Although I have been less productive this summer, been plugging away at a few things. In addition to writing and consulting, I have resumed working on my agent-based model platform.
The underlying code framework is in place, and now I have run into the interesting part: developing the decision rules for the economic agents within the model. I discovered the hard way that just winging it is not the greatest plan of action, since it is unclear what the effect of changes to behaviour are without feedback
As such, I added a screen to see the status of a market at a given instant of time. The simulation/game is real time. Economic processes like production and wage payments occur at a periodic time instants, but agents can adjust things like prices at any time. (They typically “sleep” for a a period of time, and then look at the situation and adjust decisions.)
Although the real time nature of the simulation has advantages, it also means that it is hard to see what is happening — there is a steady flow of orders and decisions going through the system, in an erratic order.
Other than things like wage and tax payments, transactions occur through markets that match versus open orders. The use of markets for transactions means that transactions need to be versus commodity items, and not particular items like depreciated equipment.
Currently, the economy has a single good (food) that is traded at two markets. The production is either at private firms, or at a governmental Job Guarantee. (The government employs workers to produce food to ensure that there is a minimum production so that we do have to worry about workers starving to death. (This would probably change once the economy has greater depth and can avoid spiralling out of control.)
Until I reach the point of fleshing out the labour market, the private sector just pays a mark-up over the Job Guarantee wage. The factory owners have two main decisions.
How many workers will they attempt to hire each day?
At what price(s) to sell the output?
The household sector is simulated as an aggregated entity (and not household-by-household), and it has a simple consumption function, going to the market to buy food. For now, largely price insensitive — just has a nominal budget, and then spends it. (The Job Guarantee holds a reserve that is available at emergency prices to avoid shenanigans.)
Now that I have a handle on what is happening within the simulation, it is now a question of tuning behavioural rules, and adding new agent types. One example might be agents that just trade the commodity for a profit.
Job Guarantee Model?
After a bit of tuning, I will have arrived at the simplest version of an agent-based simulation of a macroeconomy with a Job Guarantee. (Since the simulation has the back story that each location is a different planet, I refer to this as “MMT in Space.”) I am not sure when the model will reach the state that it is worth describing it in articles, but if I dropped everything else — which I am not — it would not be that long. The problem for this project is that it is lower priority than other ones.
The code is in Python, available at my GitHub in two repositories: https://github.com/brianr747/agent_based_macro and https://github.com/brianr747/spacetrader. (The first repository is the non-graphical simulation code that could be re-used elsewhere, the second is the graphical front end that uses pygame.