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 coeffcoefficients 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.00048.130
FeedGrains.EEC 31694.000-157.00010.680
FeedGrains.UKIreland 12720.000-63.0005.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.000427.000-190.000
Wheat .EEC 12655.000213.000-74.000
Wheat .UKIreland 1441.00030.000-8.000
FeedGrains.US 98438.000-694.0002163.000
FeedGrains.EEC 16531.000-85.000207.000
FeedGrains.UKIreland 5446.000-35.00068.000
FeedGrains.Other 2479.000
Beef .US 6536.000-84.0005.900
Beef .EEC 3235.000-24.0002.900
Beef .UKIreland 808.000-6.0001.000
Beef .Other 584.000
---- 84 PARAMETER transCostTransportation Cost Matrix
US EEC UKIreland Other
Wheat .US 8.4388.03015.000
Wheat .EEC 8.4380.42015.000
Wheat .UKIreland 8.0300.42015.000
Wheat .Other 15.00015.00015.000
FeedGrains.US 8.4388.03015.000
FeedGrains.EEC 8.4380.42015.000
FeedGrains.UKIreland 8.0300.42015.000
FeedGrains.Other 15.00015.00015.000
Beef .US 84.80280.702100.000
Beef .EEC 84.8024.221100.000
Beef .UKIreland 80.7024.221100.000
Beef .Other 100.000100.000100.000
Grain .US 8.4388.03015.000
Grain .EEC 0.42015.000
Grain .UKIreland 15.000
Reproducibility
---- EQU supplysupply function
LOWER LEVEL UPPER MARGINAL
US .Wheat 18520.000018517.780018520.000039048.0000 INFES
US .FeedGrains 98438.000098451.150098438.0000143757.0000 INFES
US .Beef 6536.00006535.33906536.00007854.0000 INFES
EEC .Wheat 12655.000012653.900012655.000023152.0000 INFES
EEC .FeedGrains 16531.000016531.510016531.000021370.0000 INFES
EEC .Beef 3235.00003234.93103235.00004203.0000 INFES
UKIreland.Wheat 1441.00001441.28001441.00003059.0000 INFES
UKIreland.FeedGrains 5446.00005446.02005446.00006519.0000 INFES
UKIreland.Beef 808.0000808.1700808.00001256.0000 INFES
Other .Wheat . . . .
Other .FeedGrains 2479.00002479.00002479.00002479.0000
Other .Beef 584.0000584.0000584.0000584.0000
---- EQU demand demand function
LOWER LEVEL UPPER MARGINAL
US .Wheat -15364.0000-15364.1216-15364.000015032.0000 INFES
US .FeedGrains -140556.0000-140550.4133-140556.0000128448.0000 INFES
US .Beef -14190.0000-14189.7505-14190.00008438.0000 INFES
EEC .Wheat -14383.0000-14382.6640-14383.000014155.0000 INFES
EEC .FeedGrains -31694.0000-31693.2192-31694.000031768.0000 INFES
EEC .Beef -6830.0000-6830.3249-6830.00004347.0000 INFES
UKIreland.Wheat -4427.0000-4427.9202-4427.00004341.0000 INFES
UKIreland.FeedGrains -12720.0000-12719.5462-12720.000013909.0000 INFES
UKIreland.Beef -2178.0000-2177.8378-2178.00001112.0000 INFES
Other .Wheat -31731.0000-31731.0000-31731.000031731.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.00024015.78739047.68566.956
Wheat .EEC 14155.0001281.5187715.21323152.08066.956
Wheat .UKIreland 3059.0003058.56767.376
Wheat .Other 81.956
Wheat .consumption 15031.89814155.3494340.08531731.000
FeedGrains.US 128448.0007919.0377389.745143756.59742.435
FeedGrains.EEC 21370.00021370.36850.873
FeedGrains.UKIreland 6519.0006519.43250.465
FeedGrains.Other 2479.0002479.00035.873
FeedGrains.consumption 128447.81531768.40413909.177
Beef .US 7854.0007854.261827.588
Beef .EEC 4203.0004203.016754.814
Beef .UKIreland 143.6471112.0001255.805750.593
Beef .Other 584.000584.000727.588
Beef .consumption 8438.2614346.6631112.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.03000.4200 +INF .
Wheat .UKIreland.EEC -0.42000.4200 +INF .
Wheat .UKIreland.Other -15.0000-14.5800 +INF .
Wheat .Other .US -15.000015.0000 +INF .
Wheat .Other .EEC -15.000015.0000 +INF .
Wheat .Other .UKIreland -15.000014.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.00006.5620 +INF .
FeedGrains.EEC .US -8.43808.4380 +INF .
FeedGrains.EEC .UKIreland -0.42000.4080 +INF .
FeedGrains.EEC .Other -15.000015.0000 +INF .
FeedGrains.UKIreland.US -8.03008.0300 +INF .
FeedGrains.UKIreland.EEC -0.4200-0.4080 +INF .
FeedGrains.UKIreland.Other -15.000014.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.802072.7746 +INF .
Beef .US .UKIreland -80.702076.9956 +INF .
Beef .US .Other -100.0000100.0000 +INF .
Beef .EEC .US -84.8020-72.7746 +INF .
Beef .EEC .UKIreland -4.22104.2210 +INF .
Beef .EEC .Other -100.000027.2254 +INF .
Beef .UKIreland.US -80.7020-76.9956 +INF .
Beef .UKIreland.EEC -4.2210-4.2210 +INF 143.6465
Beef .UKIreland.Other -100.000023.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 |