Recent Posts

Thursday, November 18, 2021

Doing Agent-Based Modelling...

I am currently working on adding functionality to my Python agent-based model framework, so no other article from me this week.

I set up a Patreon to support my Python projects, and the agent-based model is the current focus. I wrote a few small pieces this week discussing recent work: here and here.

To quickly summarise.

  • I ran into issues because I messed some high school algebra: households had too much money to start with, and were buying everything up. I needed to add functionality to view time series of data from within the model to pinpoint the problem. (The problem with models of this type is that they generate large numbers of time series, so viewing the model evolution is a challenge.)

  • Now that the model seems to be behaving as expected, I am now adding in private firms. These firms resemble agents as they are normally thought of; the earlier model “agents” were actually aggregates. (My framework is a mixture of aggregates and agents.)

The objective is to get a model of a private sector interacting with a Job Guarantee — similar to the Monetary Monopoly Model of MMT.

Email subscription: Go to 

(c) Brian Romanchuk 2021


  1. 《households had too much money to start with, and were buying everything up》

    Maybe the problem is your assumption that man's wants are infinite, but in reality don't households save more (i.e. consume purely financial goods) as they get more money?

    In other words, does mainstream economics fail to get the utility function right?

    1. It’s a pretty basic consumption function. I misjudged how much they would spend, and blew through inventories.

      Everything now is as simple as possible, as I need to get the overall structure set up before making decision logic more complex.

    2. As people make more money, don't they save more, often in money market or pension funds, which invest in financial services firms that employ traders to buy and sell complex derivatives such as inflation swaps? Can you imagine how the volume of capital involved in daily financial market trading dwarfs real economy transaction volume, as measured in dollars?

      With outsize financial returns, do price setters have more degrees of freedom than traditional economic models, based on price being mechanically set by supply and demand of real goods, allow?

      Thus, do financial markets affect real prices much more than you fathom? Does the price of gas follow the financial-market-determined price of oil? And are oil prices driven, frequently if not always, by options traders who themselves never make or take delivery of physical oil?

      Shouldn't you be increasing inventories, if you have enough money from financial investments on top of real goods revenue?

      Shouldn't you start by modeling a financial sector, where inventories are easily expanded to meet demand? (If you are an institutional trader and want to short GME, will some market maker create the shares you borrow and sell now, to buy back later at a lower price, when you return them to be destroyed or possibly sold by the original lender?)

      Are supply chains just payment chains in reverse?

    3. Inflation swaps have no direct link to what happens to actual inflation. You can’t buy the basket of goods and services to do an arbitrage. As I noted in a response to another one of your comments, the market is just an intermediary between the central government selling inflation protection to liability-matching investors, everybody else is just doing relative value or warehousing a very small amount of directional risk.

      Wholesale energy markets are wholesale markets, and a hybrid of financial and real economy actors. However, the real economy dominates. Crude oil prices went negative for a reason, and there was nothing a pure financial player can do about it. Roughly every couple of years, some idiot “rogue” trader blows up in the commodities markets because they took too large a position, and then they got squeezed by firms that dominate physical commodity trading.

      As for my modelling, these are supposed to be macro models. There is no point in modelling a financial sector that is not moored to the real economy, since we know that financial markets without outside constraints can end up doing practically anything. People do agent-based models of trading strategies already, so if I went in that direction, I would be well behind the curve.

    4. Addendum: my plan is to add something resembling a financial sector over time.


Note: Posts may be moderated, and there may be a considerable delay before they appear.

Although I welcome people who disagree with me, please be civil.

Please note that my spam comment filter appears to dislike long "anonymous" posts.

Note: if you want to post comments from Apple devices (iPhone, iPad), you apparently need to turn off "prevent cross-site tracking" in Safari privacy settings. (The reason presumably is that another URL handles comments, and so the user session needs to be preserved when redirected to that site. I don't like this, but this is not enough to make me switch my hosting service.)