this post was submitted on 29 Mar 2025
5 points (100.0% liked)
chapotraphouse
13766 readers
703 users here now
Banned? DM Wmill to appeal.
No anti-nautilism posts. See: Eco-fascism Primer
Slop posts go in c/slop. Don't post low-hanging fruit here.
founded 4 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I have some comments, questions, and possible suggestions. I think this is really great, and simulations are incredibly fun and I love digging into them. Some of my questions are because I know Python but not MatLab, so I may need to check I understand what your code is doing. Other comments may be due to differences in how quantities are calculated (particularly how the labor-value and the costs were calculated), and your final comparison of aggregated quantities instead of sector quantities. Keep in mind that I don’t mean any comment to sound aggressive, and it is possible that I am misunderstanding the code or the concept that the calculation represents.
Because I don’t know MatLab well, I’m going to go through the sections of the code and we can confirm my understanding of each part.
1.) You make N economic simulations. For each iterative economic simulation, i, you:
2.) First, generate a random net product vector n for the global economy (you call it o in the simulation).
3.) Then you randomly generate an input output table A.
4.) Then you calculate the gross product vector q, or as you call it O. This is calculated via q = (I-A)^-1^ n. It took me a while to realize that “\” is MatLab’s way of doing a matrix inverse followed by a multiplication. So A \ b is MatLab’s way of calculating A^-1^b, correct?
5.) You calculate the gross labor use as L=l q. This is element wise multiplication, or equivalently, the dot product. I wasn’t sure why you normalized the net product and the gross labor, though.
I added in the explict checks. It turns out, a huge number of the matrices being produced were non-productive. Instead of trying to keep generating matrices, I made a different fix (which makes the technical matrices more realistic, so win-win)
I made it so that the average number of entries in each row of the technical matrix is (2*n)^0.5
This means that as the economy grows larger, the matrices grow sparser. This makes productive matrices much more likely (at which point, I just have a check which makes it so that non-productive matrices are regenerated).
Curiously, this change doesn't have that big of an effect on the outcome. I've verified. The model simply handles negative net production and treats it like purchasing commodities from the external market (so something like imports). Still, I have removed it for now.