$ONTEXT The SAM X1 X2 CONS1 CONS2 X1 40 70 110 X2 60 30 90 CONS1 50 50 100 CONS2 60 40 100 110 90 100 100 $OFFTEXT *Calibration * We have to declare some initial parameters PARAMETERS ALPHA1 ALPHA2 A1 A2 ; * Lets calibrate those ALPHA1 = 40 / (50 + 50); ALPHA2 = FILL_IN; A1 = 100 / ( 40**ALPHA1 * 60**(1 - ALPHA1) ); A2 = FILL_IN; * Now lets introduce our vars VARIABLES C1X1 Consumption of X1 by consumer 1 C1X2 Consumption of X2 by consumer 1 C2X1 Consumption of X1 by consumer 2 C2X2 Consumption of X2 by consumer 2 W1 Consumer 1 utility W2 Consumer 2 utility P1 Price of X1 P2 Price of X2 PW1 Consumer 1 price index PW2 Consumer 2 price index INC1 Consumer 1 income INC2 Consumer 2 income TRICK A trick variable ; EQUATIONS MKT_X1 Market clearing for X1 MKT_X2 Market clearing for X1 MKT_W1 Market clearing for W1 MKT_W2 Market clearing for W2 PW1_IDX Consumer 1 price index PW2_IDX Consumer 2 price index I_INC1 Income balance 1 I_INC2 Income balance 2 TRCK A trick equation ; MKT_X1.. 50 + 60 =E= alpha1 * W1 * PW1 / P1 + alpha2 * W2 * PW2 / P1; MKT_X2.. FILL_IN MKT_W1.. INC1 =E= PW1*W1; MKT_W2.. FILL_IN PW1_IDX.. PW1 =E= FILL_IN PW2_IDX.. PW2 =E= FILL_IN I_INC1.. P1 * 50 + P2 * 50 =E= INC1; I_INC2.. FILL_IN =E= INC2; TRCK.. TRICK=E=1; MODEL EXCHANGE / MKT_X1 MKT_X2 MKT_W1 MKT_W2 PW1_IDX PW2_IDX I_INC1 I_INC2 TRCK /; $ONTEXT Here is the SAM again so it is easier to input starting values X1 X2 CONS1 CONS2 X1 40 70 110 X2 60 30 90 CONS1 50 50 100 CONS2 60 40 100 110 90 100 100 $OFFTEXT C1X1.L=40; C1X2.L=60; C2X1.L=70; C2X2.L=30; W1.L=100; W2.L=100; P1.L=1; P2.L=1; PW1.L=1; PW2.L=1; INC1.L=100; INC2.L=100; TRICK.L=1; option nlp = pathnlp ; SOLVE exchange USING NLP maximizing TRICK; * Exercises 1: * 1. Fill in the gaps so that the model is calibrated. * 2. Introduce a numeraire and see if the Walras Law holds * 3. Increase endowment of good X1 of consumer 1. What happens? * 4. Introduce a lump sum transfer between consumers. How this transfer affects equlibrium variables? * 5. Rewrite the whole model in the vector form (with sets)