Live data from Hacker News

Building an economy simulator from scratch

thomassimon.dev

161–170 of 217 posts

Re: Building an economy simulator from scratch

#161

In the late 80s, I typed in a BASIC economy simulator I found in some computer magazine. It ran to two or three closely-typed pages (sides). As Chancellor of the Exchequer, you set the tax-rate, interest rate, level of public spending and so on; then you ran a cycle. I can't remember whether a cycle was a month or a year. After about three years, the workers would be on strike and there would be rioting in the street…

If you like playing this sort of thing I must recommend NetLogo [0]. It's an "agent" based modelling environment, so you have to "discretize" (yuck) your problem first. I learned about it because Scott Page uses it for his "Model Thinking" class [1]. [0] https://ccl.northwestern.edu/netlogo/ [1] https://modelthinker.wordpress.com/ There is also the MIT "systems modelling for a complex world"

+1 - I studied Netlogo when I dabbled in economic simulation several years back. And alas as a non-software engineer my coding skills were not up to the task for even Netlogo's simplified interface. Yet NL serves as a valuable wrapper for any mesh- or distributed agent programming problem - (for those more skilled than me). One doesn't have to know OOP or anything to get an instructive simulation - (e.g. wolves vs sheep vs grass behavior) up and running. =)

Re: Building an economy simulator from scratch

#162

Earlier quoted context omitted.

Mostly banks borrow from depositors and from the capital markets. Reserve requirements of that type still do exist in some places (though in some places they've been abolished) but don't really play much of a role in determining how quickly money supply grows any more. Control over money supply growth is mostly down to interest rates these days. Similarly, the role reserve requirements used to play in protecting depo…

Banks don’t borrow from depositors. Loans create deposits and the deposits just change ownership tag from then on.

I mean, they do, to the extent that people walk into banks and hand over wads of cash for deposit. I.e. it happens, but increasingly rarely.

Re: Building an economy simulator from scratch

#163
post #68

Earlier quoted context omitted.

The "good" news is that gravity hates the Tower of Babel that every society inevitably produces.

The "bad" news is that this kind of gravity tends to get called things like "The Reign of Terror".

No, no: the jackwagons atop the Tower engage in the reign of terror.

The gravity at work here is economics, as seen through the lens of people. People, it turns out, don't flourish in captivity.

Re: Building an economy simulator from scratch

#164

In the late 80s, I typed in a BASIC economy simulator I found in some computer magazine. It ran to two or three closely-typed pages (sides). As Chancellor of the Exchequer, you set the tax-rate, interest rate, level of public spending and so on; then you ran a cycle. I can't remember whether a cycle was a month or a year. After about three years, the workers would be on strike and there would be rioting in the street…

Ah, you see, you have to turn off the IS_FRANCE option.

Re: Building an economy simulator from scratch

#165

Am I the only one to find the simulation deviate from the description starting from Simulation 8? For example, I see a farmer with 7 food, 7 water and 7 wood, buying water. According to the description, their QoL would be 7 both before and after the transaction, so they are not supposed to buy because there wouldn't be an increase of their QoL: > People are potential buyers of the resources that increase their qualit…

Author here, In case all resources are equally owned, the QoL is bound to all of them (as opposed to none). It does take multiple purchases to increase the QoL, but it is the only way. Otherwise people would starve due to aboulomania.

The average QoL is sampled each end of day, step 73-75 depending on the random seed. At step 72 you are seeing the zeroth day average QoL ,with nearly all the intraday mutations of the first day.

Re: Building an economy simulator from scratch

#166
post #68

Earlier quoted context omitted.

The "bad" news is that this kind of gravity tends to get called things like "The Reign of Terror".

No, no: the jackwagons atop the Tower engage in the reign of terror. The gravity at work here is economics, as seen through the lens of people. People, it turns out, don't flourish in captivity.

People don't flourish when most of their productive output is sucked up by some neo-feudal lord, either.

For some reason, capital is currently consolidating at the top.

Re: Building an economy simulator from scratch

#167

Earlier quoted context omitted.

Mostly banks borrow from depositors and from the capital markets. Reserve requirements of that type still do exist in some places (though in some places they've been abolished) but don't really play much of a role in determining how quickly money supply grows any more. Control over money supply growth is mostly down to interest rates these days. Similarly, the role reserve requirements used to play in protecting depo…

Banks don’t borrow from depositors. Loans create deposits and the deposits just change ownership tag from then on.

A deposit is literally you lending money to your bank, payable on demand.

Re: Building an economy simulator from scratch

#168
post #89
post #82

First, I really appreciate author trying to understand economy better in this way, even though this simulation is quite naive. I think everybody should do that. But as others have noted, it has no concept of capital, private property, and labor market. Therefore, it's not capitalism. It's not anarchism or communism either - it lacks flexibility of workers to do something else, or state planning telling workers to do…

Would rich people be able to stop you from creating a good economy simulator? At the end of the day, it's programming. Someone who has studied economics could make that without rich people coming after him. I argue that no one would come after you if you were to do so.

Yes because a rich person demands I pay them money for housing, which among other things I need to survive, and my precious programming time is spent under a different rich person to get that money.

Re: Building an economy simulator from scratch

#169
If you actually want to simulate an economy, the answer is complex dynamic systems. Traditional static equilibrium models (like Computational General Equilibrium (CGE) or the not actually very dynamic Dynamic Stochastic General Equlibrium (DSGE) models) are pretty useless (they have all these 'nudging' variables to try and push things towards reality but the actual underlying methodology is bunk).

Even weather forecasting moved to dynamical systems models decades ago, economics still hasn't caught up.

Post reply on HN