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.
correct
correct
I was under the impression that since matlab's "rand" generates values between 0 and 1, all of the technical matrices should be automatically productive, but you are correct. I should add explicit checks
yes
I normalise the net product so that different economies are more comparable to one another. I am interested in the ratio of output between 2 industries, and not the scale of overall production
I normalise the gross labor use because that variable should actually be "share of workforce employed". The name is a relic from my previous attempt at the code where I had tried to incorporate the population into the sim. I seem to have forgotten to change the name.
Matlab's elementwise multiplication is not a dot product