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.
6.) Calculating the LTV “prices” is the part that confuses me the most and I have a few comments and questions on
You calculate this by first calculating (I-A)^-1^, and then perform an element-wise multiplication (this is what “.*” does in MatLab, correct?) by the labor coefficient vector l. Then you sum this together.
I am confused by this calculation as the standard equation for calculating labor values is v = v A + l = l (I-A)^-1^. Note that l is a 1 x n row vector and so v is also a row (or left) vector. Alternatively, you could calculate with column vectors and the transpose of the inverse, i.e. v = ((I-A)^-1^)^T^ l.
This gives you the amount of labor required in a vertically integrated subsystem to produce one unit net product. This is using Sraffa and Pasinetti’s work to give a more concrete theoretical understanding of what a labor-value is. It is like a total labor input per unit net product. By that definition, though, it isn’t meaningful to sum up these elements as they don’t have the same units. You would first have to multiply v by some commodity-quantity, typically the net product. Note that v n = L, this provides an alternative way to “dividing up” the economy’s social labor.
This is similar to how you couldn’t actually meaningful sum up the elements of a price vector, p. A price has the units of money per unit commodity, and each commodity would hence have a different price unit. You would first have to multiply each price by the quantity of commodities that one is purchasing in order to convert it to a common unit (money) and then you could add it up. The same logic works for the standard definition of the labor value vector.
Another reason to not sum the value vector is that it would be useful to compare each element of the value vector, i.e. each commodity’s labor value, to the emergent price in the market. But, this would require you to add a mechanism where each firm can adjust prices and I don’t believe that has been added into the model yet. At the moment you are comparing aggregate quantities, i.e. the sum of prices with the sum of values-per-commodity (which I am not confident is meaningful in your present calculation), but an improvement could be to compare each sector’s emergent price (the price required for reproduction) with the sector’s labor value. In another post I have some papers where you can read how Ian Wright’s simulations handle the price adjustment and the reallocation of labor. This can be one possible future direction to head toward. I.e. you can inspect the ratio of p~i~ / v~i~ for each sector i.
7.) Then you have a vector of randomized prices. This is an n x 1000 table, though. I am confused why there is an extra 1000 here, when the loop itself will create 1000 instances of the economy. I may be misunderstanding the intention of this step so any clarification can help.
8.) You then calculate the costs, the sales to consumers, the total wages paid out, and the net income (I am also confused why the net income is normalized)? Some of the cost calculations confuse me, so I will discuss my understanding of calculating cost and we can also check if we are converging on our understanding: Sector i will spend the following amount of money on their means of production per unit product:
unit cost~i~ = p~1~ a_~1,i~ + p~2~a_~2,i~ + …
This is the amount of money that sector i must shell out to all other sectors in order to built a unit quantity. You can think of it as the row vector of prices multiplied by the i-th column in the input-output matrix A.
This unit cost for each sector can be expressed via matrix algebra as
unit cost = p A where p is a n x 1 row vector of prices
This gives you a row vector of each sector’s unit cost.
Alternatively, you can calculate this as unit cost = A^T^ p where p is a column vector. I just prefer to use column vectors for physical quantity vectors, and row vectors for prices, labor coefficients, and values. It makes the math easier to write, and you avoid transposing. It also hints at a duality present in the system.
Since this is a unit cost, we can calculate the total cost of production for sector i as
cost~i~ = unit cost~i~ x q~i~ = (p~1~ a~1,i~ + p~2~a~2,i~ + …) q~i~
You can do this for all sectors by first calculating the unit cost vector above, so you can do p A using matrix multiplication, then you can convert these unit costs to real costs by element-wise multiplication with q. This will give you each sector’s individual costs for means of production.
If you wanted aggregate costs for the whole economy though, then you can do the matrix multiplication of p A q, but I would suggest moving from an aggregate to a sector-specific model so you can test the differences between sector prices and sector labor values. I think that would be very interesting!
The money that each sector receives would then be the element-wise multiplication of p~i~ q~i~. If you wanted an aggregate quantity across all sectors, this would be the p q - you have already calculated this as R.
Then you also need to include the wage payments for each sector. Each sector pays there workers w l~i~ q~i~ = w L~i~. In the aggregate if workers are spending all of their wage and they are the only consumers of the net product, then w L = p n. But if you wanted to find how much each sector was spending for their wages, then you have to disaggregate this. You could Introduce the wage as a new parameter. Then the total wage spend by each sector is w l~i~ q~i~ = w L~i~
Divide the working class into sectors, just as the industry is divided, and note that the i-th working class consumes a proportion of L~i~/L n of the net product. Then, by conservation of the worker’s wages with their expenditure, note that wage spent by each sector is then p~i~ n~i~ L~i~/L.
With that, you can then find the net income as you have. And perhaps this is what you’ve done, but just in an aggregate way. As I mentioned, MatLab code is a little difficult for me to understand. And also, I think disaggregating this can be a good next step!
the 1000 different prices are there to see what happens to the reproduction condition with 1000 different prices. I am not directly calculating reproduction prices for each economy. I am just letting random guesses show me what happens to the reproduction condition at various price points.
The net income being normalised was there just to improve the visualisation. I have run the code with all sorts of parameters with and without the normalisation, and it is difficult to decide which is more useful for gaining insight.
I've tried generating economies with upto 100 sectors (my poor laptop), but right now, I am facing a different problem I am trying to solve (with more and more sectors, my current random price generation strategy rarely ever produces prices close to LTV. Law of large numbers and all).
This is what I have done in C (except I also multiplied by gross output yo get total costs per sector)
R is a vector denoting the revenue by sector. I think part of your misunderstanding might be from MatLab's element-wise multiplication function, whose output can be difficult to understand.
O is a n long coming vector, P is a n long column vector, when element wise multiplied, the output is also a n long column vector.
And I do suppose that using standard notation (which I have never seen before tbh) would probably help greatly.