Just a quick experiment with a small price-endogenous spatial equilibrium model.
In this problem, we consider commodities (goods) produced and consumed in different regions. We can trade between regions.
This price-endogenous spatial model will find both equilibrium prices, supplies, demand quantities, and trade patterns. Our model will have a connection with the transportation model. The difference is that we formulate the model as a system of complementarity constraints (no objective), with the duals explicitly in the model as variables. Or, in other words, we solve the KKT conditions.
I use a small data set from [3], and see if we can reproduce things.
Demand and supply functions
In the simplest form, we assume we have estimated linear supply and demand curves as follows: \[\begin{align}&\color{darkred}{Q}^{\color{darkred}d}_{c,r} = \color{darkblue}a_{c,r} + \color{darkblue}b_{c,r}\color{darkred}{P}_{c,r}\\ &\color{darkred}{Q}^{\color{darkred}s}_{c,r} = \color{darkblue}\alpha_{c,r} + \color{darkblue}\beta_{c,r}\color{darkred}{P}_{c,r}\end{align}\] The means, the demand and supply quantities depend on the price, The indices \(c,r\) indicate the commodity and region.
Notes:
- Demand/supply functions are typically of the form \(\color{darkred}Q=f(\color{darkred}P)\). Some models use the inverse demand and supply functions: \(\color{darkred}P=f^{-1}(\color{darkred}Q)\). Of course, when solved as a system of equations, this does not make a difference: we can use either form.
- We can assume the demand function is downward sloping (higher prices mean less demand) and the supply function is upward sloping (higher prices mean more supply). Normal goods all follow this. There are only very rare cases where this is not the case. Examples of goods with upward-sloping demand curves are Giffen and Veblen goods [1].
- The demand and supply functions can be a little bit more complicated by also considering the prices of other goods. E.g. the supply of beef may depend on the price of beef but also on the price of feed grains. For the latter, we would expect that if feed prices increase, the supply of beef decreases. We can write in general:\[\begin{align}&\color{darkred}{Q}^{\color{darkred}d}_{c,r} = \color{darkblue}a_{c,r} + \sum_{c'}\color{darkblue}b_{c,r,c'}\color{darkred}{P}_{c',r}\\ &\color{darkred}{Q}^{\color{darkred}s}_{c,r} = \color{darkblue}\alpha_{c,r} + \sum_{c'}\color{darkblue}\beta_{c,r,c'}\color{darkred}{P}_{c',r}\end{align}\] This is the form [3] is using.
- A possible way to find values for the coefficients of these functions is to use an econometric analysis (regression). When we don't have enough data for that, another approach can be used called calibration.
Transportation cost
- \(\color{darkred}{P}_{c,r}+\color{darkblue}{tc}_{c,r,r'}\lt \color{darkred}{P}_{c,r'}\). This means there is a profit to be made by shipping more from \(r \rightarrow r'\). That means we are not in equilibrium: we will start shipping leading to other prices and quantities. Or stated differently: we are violating the zero-profit equilibrium condition.
- \(\color{darkred}{P}_{c,r}+\color{darkblue}{tc}_{c,r,r'}\gt \color{darkred}{P}_{c,r'}\). This means that the price differential is not large enough to pay for the shipping cost. The result should be: no shipping from \(r \rightarrow r'\), or \(\color{darkred}x_{c,r,r'}=0\) where \(\color{darkred}x_{c,r,r'}\) indicate our trade flows.
- \(\color{darkred}{P}_{c,r}+\color{darkblue}{tc}_{c,r,r'}= \color{darkred}{P}_{c,r'}\). This case allows for shipping: \(\color{darkred}x_{c,r,r'}\ge 0\).
- \(\color{darkred}x_{c,r,r'}\gt 0 \Rightarrow \color{darkred}{P}_{c,r}+\color{darkblue}{tc}_{c,r,r'} = \color{darkred}{P}_{c,r'} \) and
- \( \color{darkred}{P}_{c,r}+\color{darkblue}{tc}_{c,r,r'} \gt \color{darkred}{P}_{c,r'} \Rightarrow \color{darkred}x_{c,r,r'}= 0\)
Other equilibrium conditions
Spatial Equilibrium Model | |
---|---|
Sets | |
\(c,c'\) | Commodities |
\(r,r'\) | Regions |
Variables | |
\(\color{darkred}{Q}^{\color{darkred}s}_{c,r}\) | Supply quantities |
\(\color{darkred}{Q}^{\color{darkred}d}_{c,r}\) | Demand quantities |
\(\color{darkred}{P}_{c,r}\) | Prices |
\(\color{darkred}{x}_{c,r,r'}\) | Shipped quantities |
Equations | |
\[\color{darkred}{Q}^{\color{darkred}s}_{c,r} = \color{darkblue}\alpha_{c,r} + \sum_{c'}\color{darkblue}\beta_{c,r,c'}\color{darkred}{P}_{c',r}\] | Supply equation |
\[\color{darkred}{Q}^{\color{darkred}d}_{c,r} = \color{darkblue}a_{c,r} + \sum_{c'}\color{darkblue}b_{c,r,c'}\color{darkred}{P}_{c',r}\] | Demand equation |
\[\color{darkred}{Q}^{\color{darkred}s}_{c,r} + \sum_{r'}\color{darkred}x_{c,r',r}= \color{darkred}{Q}^{\color{darkred}d}_{c,r} + \sum_{r'}\color{darkred}x_{c,r,r'}\] | Flow balance (production + import = consumption + export) |
\[\color{darkred}{P}_{c,r} + \color{darkblue}{tc}_{c,r,r'} \ge \color{darkred}{P}_{c,r'} \perp \color{darkred}x_{r,r',c}\ge 0\] | Transportation |
\[\color{darkred}{x}_{c,r,r} = 0\] | Exclude diagonal |
Data
---- 84 PARAMETER coeff coefficients for demand and supply functions INDEX 1 = Demand Intercept Wheat FeedGrains Beef Wheat .US 15364.000 -4.960 Wheat .EEC 14383.000 -3.400 Wheat .UKIreland 4427.000 -1.290 Wheat .Other 31731.000 FeedGrains.US 140556.000 -1224.000 48.130 FeedGrains.EEC 31694.000 -157.000 10.680 FeedGrains.UKIreland 12720.000 -63.000 5.820 Beef .US 14190.000 -6.950 Beef .EEC 6830.000 -3.290 Beef .UKIreland 2178.000 -1.420 INDEX 1 = Supply Intercept Wheat FeedGrains Beef Wheat .US 18520.000 427.000 -190.000 Wheat .EEC 12655.000 213.000 -74.000 Wheat .UKIreland 1441.000 30.000 -8.000 FeedGrains.US 98438.000 -694.000 2163.000 FeedGrains.EEC 16531.000 -85.000 207.000 FeedGrains.UKIreland 5446.000 -35.000 68.000 FeedGrains.Other 2479.000 Beef .US 6536.000 -84.000 5.900 Beef .EEC 3235.000 -24.000 2.900 Beef .UKIreland 808.000 -6.000 1.000 Beef .Other 584.000 ---- 84 PARAMETER transCost Transportation Cost Matrix US EEC UKIreland Other Wheat .US 8.438 8.030 15.000 Wheat .EEC 8.438 0.420 15.000 Wheat .UKIreland 8.030 0.420 15.000 Wheat .Other 15.000 15.000 15.000 FeedGrains.US 8.438 8.030 15.000 FeedGrains.EEC 8.438 0.420 15.000 FeedGrains.UKIreland 8.030 0.420 15.000 FeedGrains.Other 15.000 15.000 15.000 Beef .US 84.802 80.702 100.000 Beef .EEC 84.802 4.221 100.000 Beef .UKIreland 80.702 4.221 100.000 Beef .Other 100.000 100.000 100.000 Grain .US 8.438 8.030 15.000 Grain .EEC 0.420 15.000 Grain .UKIreland 15.000
Reproducibility
---- EQU supply supply function LOWER LEVEL UPPER MARGINAL US .Wheat 18520.0000 18517.7800 18520.0000 39048.0000 INFES US .FeedGrains 98438.0000 98451.1500 98438.0000 143757.0000 INFES US .Beef 6536.0000 6535.3390 6536.0000 7854.0000 INFES EEC .Wheat 12655.0000 12653.9000 12655.0000 23152.0000 INFES EEC .FeedGrains 16531.0000 16531.5100 16531.0000 21370.0000 INFES EEC .Beef 3235.0000 3234.9310 3235.0000 4203.0000 INFES UKIreland.Wheat 1441.0000 1441.2800 1441.0000 3059.0000 INFES UKIreland.FeedGrains 5446.0000 5446.0200 5446.0000 6519.0000 INFES UKIreland.Beef 808.0000 808.1700 808.0000 1256.0000 INFES Other .Wheat . . . . Other .FeedGrains 2479.0000 2479.0000 2479.0000 2479.0000 Other .Beef 584.0000 584.0000 584.0000 584.0000 ---- EQU demand demand function LOWER LEVEL UPPER MARGINAL US .Wheat -15364.0000 -15364.1216 -15364.0000 15032.0000 INFES US .FeedGrains -140556.0000 -140550.4133 -140556.0000 128448.0000 INFES US .Beef -14190.0000 -14189.7505 -14190.0000 8438.0000 INFES EEC .Wheat -14383.0000 -14382.6640 -14383.0000 14155.0000 INFES EEC .FeedGrains -31694.0000 -31693.2192 -31694.0000 31768.0000 INFES EEC .Beef -6830.0000 -6830.3249 -6830.0000 4347.0000 INFES UKIreland.Wheat -4427.0000 -4427.9202 -4427.0000 4341.0000 INFES UKIreland.FeedGrains -12720.0000 -12719.5462 -12720.0000 13909.0000 INFES UKIreland.Beef -2178.0000 -2177.8378 -2178.0000 1112.0000 INFES Other .Wheat -31731.0000 -31731.0000 -31731.0000 31731.0000 Other .FeedGrains . . . . Other .Beef . . . .
---- supply =E= supply function supply(US,Wheat).. Qs(US,Wheat) - 427*P(US,Wheat) + 190*P(US,FeedGrains) =E= 18520 ; (LHS = 18517.78, INFES = 2.22000000000116 ****) supply(US,FeedGrains).. Qs(US,FeedGrains) + 694*P(US,Wheat) - 2163*P(US,FeedGrains) =E= 98438 ; (LHS = 98451.15, INFES = 13.1499999999942 ****) supply(US,Beef).. Qs(US,Beef) + 84*P(US,FeedGrains) - 5.9*P(US,Beef) =E= 6536 ; (LHS = 6535.339, INFES = 0.661000000000968 ****) ---- demand =E= demand function demand(US,Wheat).. - Qd(US,Wheat) - 4.96*P(US,Wheat) =E= -15364 ; (LHS = -15364.1216, INFES = 0.121600000000399 ****) demand(US,FeedGrains).. - Qd(US,FeedGrains) - 1224*P(US,FeedGrains) + 48.13*P(US,Beef) =E= -140556 ; (LHS = -140550.4133, INFES = 5.58670000001439 ****) demand(US,Beef).. - Qd(US,Beef) - 6.95*P(US,Beef) =E= -14190 ; (LHS = -14189.7505, INFES = 0.249499999999898 ****)
supply(US,Wheat).. Qs(US,Wheat) - 427*P(US,Wheat) + 190*P(US,FeedGrains) =E= 18520 ;
Qs(US,Wheat) 39048P(US,Wheat) 66.96P(US,FeedGrains) 42.43
---- 197 PARAMETER mysol our solution US EEC UKIreland Other production price Wheat .US 15032.000 24015.787 39047.685 66.956 Wheat .EEC 14155.000 1281.518 7715.213 23152.080 66.956 Wheat .UKIreland 3059.000 3058.567 67.376 Wheat .Other 81.956 Wheat .consumption 15031.898 14155.349 4340.085 31731.000 FeedGrains.US 128448.000 7919.037 7389.745 143756.597 42.435 FeedGrains.EEC 21370.000 21370.368 50.873 FeedGrains.UKIreland 6519.000 6519.432 50.465 FeedGrains.Other 2479.000 2479.000 35.873 FeedGrains.consumption 128447.815 31768.404 13909.177 Beef .US 7854.000 7854.261 827.588 Beef .EEC 4203.000 4203.016 754.814 Beef .UKIreland 143.647 1112.000 1255.805 750.593 Beef .Other 584.000 584.000 727.588 Beef .consumption 8438.261 4346.663 1112.158
Complementarity in the solution
---- EQU trade prices LOWER LEVEL UPPER MARGINAL Wheat .US .EEC -8.4380 . +INF . Wheat .US .UKIreland -8.0300 -0.4200 +INF . Wheat .US .Other -15.0000 -15.0000 +INF 24015.7872 Wheat .EEC .US -8.4380 . +INF . Wheat .EEC .UKIreland -0.4200 -0.4200 +INF 1281.5180 Wheat .EEC .Other -15.0000 -15.0000 +INF 7715.2128 Wheat .UKIreland.US -8.0300 0.4200 +INF . Wheat .UKIreland.EEC -0.4200 0.4200 +INF . Wheat .UKIreland.Other -15.0000 -14.5800 +INF . Wheat .Other .US -15.0000 15.0000 +INF . Wheat .Other .EEC -15.0000 15.0000 +INF . Wheat .Other .UKIreland -15.0000 14.5800 +INF . FeedGrains.US .EEC -8.4380 -8.4380 +INF 7919.0367 FeedGrains.US .UKIreland -8.0300 -8.0300 +INF 7389.7450 FeedGrains.US .Other -15.0000 6.5620 +INF . FeedGrains.EEC .US -8.4380 8.4380 +INF . FeedGrains.EEC .UKIreland -0.4200 0.4080 +INF . FeedGrains.EEC .Other -15.0000 15.0000 +INF . FeedGrains.UKIreland.US -8.0300 8.0300 +INF . FeedGrains.UKIreland.EEC -0.4200 -0.4080 +INF . FeedGrains.UKIreland.Other -15.0000 14.5920 +INF . FeedGrains.Other .US -15.0000 -6.5620 +INF . FeedGrains.Other .EEC -15.0000 -15.0000 +INF 2479.0000 FeedGrains.Other .UKIreland -15.0000 -14.5920 +INF . Beef .US .EEC -84.8020 72.7746 +INF . Beef .US .UKIreland -80.7020 76.9956 +INF . Beef .US .Other -100.0000 100.0000 +INF . Beef .EEC .US -84.8020 -72.7746 +INF . Beef .EEC .UKIreland -4.2210 4.2210 +INF . Beef .EEC .Other -100.0000 27.2254 +INF . Beef .UKIreland.US -80.7020 -76.9956 +INF . Beef .UKIreland.EEC -4.2210 -4.2210 +INF 143.6465 Beef .UKIreland.Other -100.0000 23.0044 +INF . Beef .Other .US -100.0000 -100.0000 +INF 584.0000 Beef .Other .EEC -100.0000 -27.2254 +INF . Beef .Other .UKIreland -100.0000 -23.0044 +INF .
Note that the column MARGINAL prints the levels of the variable \(\color{darkred}x_{r,r',c}\). Indeed we can see that shipping occurs (\(\color{darkred}x_{r,r',c}\gt 0\)) only when the constraint is binding. And the reverse: for all cases where the constraint level is not at its lower bound, the variable \(\color{darkred}x_{r,r',c}=0\). This report is just like for an LP, except that the dual (or marginal) is now an explicit model variable.
Conclusion
References
- Giffen goods, https://www.investopedia.com/terms/g/giffen-good.asp
- Samuelson, Paul A., "Spatial Price Equilibrium and Linear Programming," Am. Econ. Rev. 42:283-303, June 1952
- D. Lee Bawden, "A Spatial Price Equilibrium Model of International Trade", American Journal of Agricultural Economics, Volume 48, November 1966, Pages 862-874
- Solving Linear Complementarity Problems without an LCP Solver, https://yetanothermathprogrammingconsultant.blogspot.com/2021/05/solving-linear-complementarity-problems.html
Appendix. GAMS Model
$ontext |
No comments:
Post a Comment