-
Notifications
You must be signed in to change notification settings - Fork 0
/
OPENFIX_S
1620 lines (1285 loc) · 44.7 KB
/
OPENFIX_S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
' MODEL OPENFIX_S for Eviews version 10
' CJE WEB version
' Created by E. Carnevali and M. Veronese Passarella, 12 February 2020
' ****************************************************************************
' Create a workfile, naming it openfix, to hold annual data from 1950 to 2050
wfcreate(wf = openfix_s, page = annual) a 1950 2100
smpl @all
'*****************************************************************************
'Create and set import and export price elasticities
series mu1
mu1.label(d) Parameter determining real imports in Country A
mu1 = 0.5 '0.7
series eps1
eps1.label(d) Parameter determining real exports in Country A
eps1 = 1 - mu1 'no improvement according to MLC (original value = 0.7)
'*****************************************************************************
' Creates and documents series
series b_AA_d
b_AA_d.label(d) Bills issued by Country A acquired by Country A: demand
series b_AA_s
b_AA_s.label(d) Bills issued by Country A acquired by Country A: supply
series b_cb_AB_d
b_cb_AB_d.label(d) Bills issued by Country B, demanded by Country A Central bank
series b_cb_AB_s
b_cb_AB_s.label(d) Bills issued by Country B, supplied to Country A Central bank
series b_cb_AA_d
b_cb_AA_d.label(d) Bills issued by Country A, demanded by Country A Central bank
series b_cb_AA_s
b_cb_AA_s.label(d) Bills issued by Country A, supplied to Country A Central bank
series b_A_s
b_A_s.label(d) Bills issued by Country A - total supply
series b_AB_d
b_AB_d.label(d) Bills issued by Country B acquired by Country A: demand
series b_AB_s
b_AB_s.label(d) Bills issued by Country B acquired by Country A: supply
series b_BA_d
b_BA_d.label(d) Bills issued by Country A acquired by Country B: demand
series b_BA_s
b_BA_s.label(d) Bills issued by Country A acquired by Country B: supply
series b_B_s
b_B_s.label(d) Bills issued by Country B - total supply
series b_BB_d
b_BB_d.label(d) Bills issued by Country B acquired by Country B: demand
series b_BB_s
b_BB_s.label(d) Bills issued by Country B acquired by Country B: supply
series b_cb_BB_d
b_cb_BB_d.label(d) Bills issued by Country B demanded by Country B Central Bank
series b_cb_BB_s
b_cb_BB_s.label(d) Bills issued by Country B supplied to Country B Central Bank
series c_k_A
c_k_A.label(d) Real consumption in Country A
series c_k_B
c_k_B.label(d) Real consumption in Country B
series cab_A
cab_A.label(d) Current account balance in Country A
series cab_B
cab_B.label(d) Current account balance in Country B
series cons_A
cons_A.label(d) Consumption in Country A
series cons_B
cons_B.label(d) Consumption in Country B
series ds_A
ds_A.label(d) Domestic sales in Country A
series ds_B
ds_B.label(d) Domestic sales in Country B
series ds_k_A
ds_k_A.label(d) Real domestic sales in Country A
series ds_k_B
ds_k_B.label(d) Real domestic sales in Country B
series dxre_A
dxre_A.label(d) Expected change in the exchange rate of Country A (measured as units of Country A currency against 1 unit of Country B currency)
series dxre_B
dxre_B.label(d) Expected change in the exchange rate Country B (measured as units of Country B currency against 1 unit of Country A currency)
series f_cb_A
f_cb_A.label(d) Profits of Central Bank in Country A
series f_cb_B
f_cb_B.label(d) Profits of Central Bank in Country B
series g_A
g_A.label(d) Government expenditure in Country A
series g_B
g_B.label(d) Government expenditure in Country B
series g_k_A
g_k_A.label(d) Real government expenditure in Country A
series g_k_B
g_k_B.label(d) Real government expenditure in Country B
series h_A_d
h_A_d.label(d) Demand for cash of Country A
series h_A_s
h_A_s.label(d) Supply of Country A cash
series h_B_d
h_B_d.label(d) Demand for cash of Country B
series h_B_s
h_B_s.label(d) Supply of Country B cash
series im_A
im_A.label(d) Imports of Country A from Country B
series im_B
im_B.label(d) Imports of Country B from Country A
series im_k_A
im_k_A.label(d) Real imports of Country A from Country B
series im_k_B
im_k_B.label(d) Real imports of Country B from Country A
series kab_A
kab_A.label(d) Capital account balance in Country A
series kab_B
kab_B.label(d) Current account balance in Country B
series kabp_A
kabp_A.label(d) Capital account balance in Country A, excluding official transactions
series kabp_B
kabp_B.label(d) Current account balance in Country B, excluding official transactions
series n_A
n_A.label(d) Employment in Country A
series n_B
n_B.label(d) Employment in Country B
series or_A
or_A.label(d) Gold reserves in Country A
series or_B
or_B.label(d) Gold reserves in Country B
series pds_A
pds_A.label(d) Price of domestic sales in Country A
series pds_B
pds_B.label(d) Price of domestic sales in Country B
series pg_A
pg_A.label(d) Price of gold in Country A
series pg_B
pg_B.label(d) Price of gold in Country B
series pm_B
pm_B.label(d) Price of imports in Country B
series pm_A
pm_A.label(d) Price of imports in Country A
series pr_A
pr_A.label(d) Productivity in Country A
series pr_B
pr_B.label(d) Productivity in Country B
series ps_A
ps_A.label(d) Price of sales in Country A
series ps_B
ps_B.label(d) Price of sales in Country B
series psbr_A
psbr_A.label(d) Government deficit in Country A
series psbr_B
psbr_B.label(d) Government deficit in Country B
series py_B
py_B.label(d) Price of output in Country B
series py_A
py_A.label(d) Price of imports in Country A
series px_B
px_B.label(d) Price of exports in Country B
series px_A
px_A.label(d) Price of exports in Country A
series r_A
r_A.label(d) Interest rate on Country A bills
series r_B
r_B.label(d) Interest rate on Country B bills
series s_A
s_A.label(d) Value of sales in Country A
series s_B
s_B.label(d) Value of sales in Country B
series s_k_A
s_k_A.label(d) Real sales in Country A
series s_k_B
s_k_B.label(d) Real sales in Country B
series t_A
t_A.label(d) Tax revenue in Country A
series t_B
t_B.label(d) Tax revenue in Country B
series v_A
v_A.label(d) Net financial assets of Country A
series v_B
v_B.label(d) Net financial assets of Country B
series v_k_A
v_k_A.label(d) Real net financial assets of Country A
series v_k_B
v_k_B.label(d) Real net financial assets of Country B
series w_A
w_A.label(d) Nominal wage rate in Country A
series w_B
w_B.label(d) Nominal wage rate in Country B
series x_A
x_A.label(d) Exports from Country A to Country B
series x_B
x_B.label(d) Exports from Country B to Country A
series x_k_A
x_k_A.label(d) Real exports from Country A to Country B
series x_k_B
x_k_B.label(d) Real exports from Country B to Country A
series xr_A
xr_A.label(d) Exchange rate: units of S currency against 1 unit of N currency
series xr_B
xr_B.label(d) Exchange rate: units of N currency against 1 unit of S currency
series xre_A
xre_A.label(d) Expected exchange rate: units of S currency against 1 unit of N currency
series xre_B
xre_B.label(d) Expected exchange rate: units of N currency against 1 unit of S currency
series yd_A
yd_A.label(d) Disposable income in Country A
series yd_B
yd_B.label(d) Disposable income in Country B
series ydhs_A
ydhs_A.label(d) Haig-Simons disposable income in Country A
series ydhs_B
ydhs_B.label(d) Haig-Simons disposable income in Country B
series ydhs_k_A
ydhs_k_A.label(d) Real Haig-Simons disposable income in Country A
series ydhs_k_B
ydhs_k_B.label(d) Real Haig-Simons disposable income in Country B
series ydhse_k_A
ydhse_k_A.label(d) Expected real Haig-Simons disposable income in Country A
series ydhse_k_B
ydhse_k_B.label(d) Expected real Haig-Simons disposable income in Country B
series y_A
y_A.label(d) Income in Country A
series y_B
y_B.label(d) Income in Country B
series y_k_A
y_k_A.label(d) Real income in Country A
series y_k_B
y_k_B.label(d) Real income in Country B
' Generate parameters
series alpha1_B
alpha1_B.label(d) Propensity to consume out of income Country B
series alpha2_B
alpha2_B.label(d) Propensity to consume out of wealth Country B
series alpha1_A
alpha1_A.label(d) Propensity to consume out of income Country A
series alpha2_A
alpha2_A.label(d) Propensity to consume out of wealth Country A
series eps0
eps0.label(d) Parameter determining real exports in Country A
series eps2
eps2.label(d) Parameter determining real exports in Country A
series lambda10
lambda10.label(d) Parameter in asset demand function
series lambda11
lambda11.label(d) Parameter in asset demand function
series lambda12
lambda12.label(d) Parameter in asset demand function
series lambda20
lambda20.label(d) Parameter in asset demand function
series lambda21
lambda21.label(d) Parameter in asset demand function
series lambda22
lambda22.label(d) Parameter in asset demand function
series lambda40
lambda40.label(d) Parameter in asset demand function
series lambda41
lambda41.label(d) Parameter in asset demand function
series lambda42
lambda42.label(d) Parameter in asset demand function
series lambda50
lambda50.label(d) Parameter in asset demand function
series lambda51
lambda51.label(d) Parameter in asset demand function
series lambda52
lambda52.label(d) Parameter in asset demand function
series mu0
mu0.label(d) Parameter determining real imports in Country A
series mu2
mu2.label(d) Parameter determining real imports in Country A
series nu1m
nu1m.label(d) Parameter determining import prices in Country A
series nu0m
nu0m.label(d) Parameter determining import prices in Country A
series nu1m
nu1m.label(d) Parameter determining import prices in Country A
series nu0x
nu0x.label(d) Parameter determining export prices in Country A
series nu1x
nu1x.label(d) Parameter determining export prices in Country A
series theta_A
theta_A.label(d) Tax rate in Country A
series theta_B
theta_B.label(d) Tax rate in Country B
series phi_B
phi_B.label(d) mark-up in Country B
series phi_A
phi_A.label(d) mark-up in Country A
'Additional series
series tb_B
tb_B.label(d) Country B trade balance
series tb_A
tb_A.label(d) country A trade balance
series finc_B
finc_B.label(d) Factor income to US
series finc_A
finc_A.label(d) Factor income to country A
series p_madeA
p_madeA.label(d) Basic price made in Britain goods
series p_madeB
p_madeB.label(d) Basic price made in Country B goods
' Starting values for parameters
alpha1_A = 0.75
alpha1_B = 0.75
alpha2_A = 0.13333
alpha2_B = 0.13333
eps0 = - 2.1
eps2 = 1
lambda10 = 0.7
lambda11 = 5
lambda12 = 5
lambda20 = 0.25
lambda21 = 5
lambda22 = 5
lambda40 = 0.7
lambda41 = 5
lambda42 = 5
lambda50 = 0.25
lambda51 = 5
lambda52 = 5
mu0 = - 2.1
mu2 = 1
nu0m = - 0.00001
nu0x = - 0.00001
nu1m = 0.7
nu1x = 0.5
phi_A = 0.2381
phi_B = 0.2381
theta_A = 0.2
theta_B = 0.2
' Exogenous variables
b_cb_AB_s = 0.02031
dxre_B = 0
g_k_A = 16
g_k_B = 16
or_A = 7
pg_B = 1
pr_A = 1.3333
pr_B = 1.3333
r_A = 0.03
r_B = 0.03
w_A = 1
w_B = 1
' Starting values for stocks
b_cb_AA_d = 0.27984
b_cb_AA_s = 0.27984
b_cb_AB_d = 0.0203
b_cb_BB_d = 0.29843
b_cb_BB_s = 0.29843
b_A_s = 138.94
b_AA_d = 102.18
b_AA_s = 102.18
b_AB_d = 36.493
b_AB_s = 36.504
b_B_s = 139.02
b_BA_d = 36.497
b_BA_s = 36.487
b_BB_d = 102.19
b_BB_s = 102.19
h_A_d = 7.2987
h_A_s = 7.2987
h_B_d = 7.2995
h_B_s = 7.2995
or_B = 7
v_k_A = 152.62
v_k_B = 152.63
v_A = 145.97
v_B = 145.99001
' Other endogenous
c_k_A = 81.393
c_k_B = 81.401
cab_A = 0
cab_B = 0
cons_A = 77.851
cons_B = 77.86
ds_k_A = 97.393
ds_k_B = 97.401
ds_A = 93.154
ds_B = 93.164
dxre_A = 0
f_cb_A = 0.00869
f_cb_B = 0.00895
g_A = 15.304
g_B = 15.304
im_k_A = 11.928
im_k_B = 11.926
im_A = 11.407
im_B = 11.409
kabp_A = 0.00002
kabp_B = - 0.00002
n_A = 73.046
n_B = 73.054
pds_A = 0.95648
pds_B = 0.95649
pg_A = 0.99971
pm_A = 0.95628
pm_B = 0.95661
ps_A = 0.95646
ps_B = 0.9565
px_A = 0.95634
px_B = 0.95656
py_A = 0.95648
py_B = 0.95649
s_k_A = 109.32
s_k_B = 109.33
s_A = 104.56
s_B = 104.57
t_A = 19.463
t_B = 19.465
x_k_A = 11.926
x_k_B = 11.928
x_A = 11.406
x_B = 11.41
xr_A = 1.0003
xr_B = 0.99971
xre_A = 1.0003
xre_B = 0.99971
y_k_A = 97.392
y_k_B = 97.403
y_A = 93.154
y_B = 93.164
yd_A = 77.851
yd_B = 77.86
ydhs_k_A = 81.394
ydhs_k_B = 81.402
ydhse_k_A = 81.394
ydhse_k_B = 81.402
'Additional initial values
p_madeA = 0.9626701
p_madeB= 0.9626248
'******************************************************
'Create model
model openfix
' ACCOUNTING IDENTITIES
' Disposable income in country A - eq. 12.1 MODIFIED
openfix.append yd_A = (y_A + r_A(-1)*b_AA_d(-1) + xr_B*r_B(-1)*b_AB_s(-1))*(1 - theta_A)
' Haig-Simons disposable income in country A - eq. 12.2
openfix.append yd_hs_A = yd_A + d(xr_B)*b_AB_s(-1)
' Wealth accumulation in country A - eq. 12.3 MODIFIED
openfix.append v_A = v_A(-1) + yd_hs_A - cons_A
' Disposable income in Country B - eq. 12.4 MODIFIED
openfix.append yd_B = (y_B + r_B(-1)*b_BB_d(-1) + xr_A*r_A(-1)*b_BA_s(-1))*(1 - theta_B)
' Haig-Simons disposable income in Country B - eq. 12.5
openfix.append yd_hs_B = yd_B + d(xr_A)*b_BA_s(-1)
' Wealth accumulation in Country B - eq. 12.6 MODIFIED
openfix.append v_B = v_B(-1) + yd_hs_B - cons_B
' Taxes in country A - eq. 12.7
openfix.append t_A = theta_A*(y_A + r_A(-1)*b_AA_d(-1) + xr_B*r_B(-1)*b_AB_s(-1))
' Taxes in Country B - eq. 12.8
openfix.append t_B = theta_B*(y_B + r_B(-1)*b_BB_d(-1) + xr_A*r_A(-1)*b_BA_s(-1))
' Equations 12.9 & 12.10 are dropped in favour of equations 12.53 & 12.54
' Profits of Central Bank in country A - eq. 12.11 - typo in the book for r_B
openfix.append f_cb_A = r_A(-1)*b_cb_AA_d(-1) + r_B(-1)*b_cb_AB_s(-1)*xr_B
' Profits of Central Bank in Country B - eq. 12.12
openfix.append f_cb_B = r_B(-1)*b_cb_BB_d(-1)
' Government budget constraint - country A - eq. 12.13
openfix.append b_A_s = b_A_s(-1) + g_A + r_A(-1)*b_A_s(-1) - t_A - f_cb_A
' Government budget constraint - Country B - eq. 12.14
openfix.append b_B_s = b_B_s(-1) + g_B + r_B(-1)*b_B_s(-1) - t_B - f_cb_B
' Current account balance - country A - eq. 12.15
openfix.append cab_A = x_A - im_A + xr_B*r_B(-1)*b_AB_s(-1) - r_A(-1)*b_BA_s(-1) + r_B(-1)*b_cb_AB_s(-1)*xr_B
' Capital account balance in country A - eq. 12.16
openfix.append kab_A = kabp_A - (xr_B*d(b_cb_AB_s) + pg_A*d(or_A))
' Current account balance in Country B - eq. 12.17
openfix.append cab_B = x_B - im_B + xr_A*r_A(-1)*b_BA_s(-1) - r_B(-1)*b_AB_s(-1) - r_B(-1)*b_cb_AB_s(-1)
' Capital account balance in Country B - eq. 12.18
openfix.append kab_B = kabp_B + d(b_cb_AB_s) - pg_B*d(or_B)
' Capital account balance in country A, net of official transactions - eq. 12.19
openfix.append kabp_A = - d(b_AB_s)*xr_B + d(b_BA_s)
' Capital account balance in US, net of official transactions - eq. 12.20
openfix.append kabp_B = - d(b_BA_s)*xr_A + d(b_AB_s)
' TRADE
' Import prices in country A - eq. 12.21 MODIFIED
openfix.append pm_A = exp(nu0m + nu1m*log(py_B) + (1 - nu1m)*log(py_A) - nu1m*log(xr_A))
' Export prices in country A - eq. 12.22 MODIEFIED
openfix.append px_A = exp(nu0x + nu1x*log(py_B) + (1 - nu1x)*log(py_A) - nu1x*log(xr_A))
' Export prices in Country B - eq. 12.23
openfix.append px_B = pm_A*xr_A
' Import prices in Country B - eq. 12.24
openfix.append pm_B = px_A*xr_A
' Real exports from country A - eq. 12.25 - depends on current relative price MODIFIED
openfix.append x_k_A = exp(eps0 - eps1*log(pm_B(-1)/py_B(-1)) + eps2*log(y_k_B))
' Real imports of country A - eq. 12.26 MODIFIED
openfix.append im_k_A = exp(mu0 - mu1*log(pm_A(-1)/py_A(-1)) + mu2*log(y_k_A))
' Real exports from Country B - eq. 12.27
openfix.append x_k_B = im_k_A
' Real imports of Country B - eq. 12.28
openfix.append im_k_B = x_k_A
' Exports of country A - eq. 12.29
openfix.append x_A = x_k_A*px_A
' Exports of Country B - eq. 12.30
openfix.append x_B = x_k_B*px_B
' Imports of country A - eq. 12.31
openfix.append im_A = im_k_A*pm_A
' Imports of Country B - eq. 12.32
openfix.append im_B = im_k_B*pm_B
'************************************************************************************************************************
'ADDITIONAL EQUATIONS FOR TRADE BALANCES ***
'Trade balance of country A
openfix.append tb_A = x_A - im_A
'Trade balance of US
openfix.append tb_B = x_B - im_B
'Factor income of country A
openfix.append finc_A = xr_B*r_B(-1)*b_AB_s(-1) - r_A(-1)*b_BA_s(-1) + r_B(-1)*b_cb_AB_s(-1)*xr_B
'Factor income of US
openfix.append finc_B = xr_A*r_A(-1)*b_BA_s(-1) - r_B(-1)*b_AB_s(-1) - r_B(-1)*b_cb_AB_s(-1)
'************************************************************************************************************************
' INCOME AND EXPENDITURE
' Real wealth in country A - eq. 12.33
openfix.append v_k_A = v_A/pds_A
' Real wealth in Country B - eq. 12.34
openfix.append v_k_B = v_B/pds_B
' Real Haig-Simons disposable income in country A - eq. 12.35 MODIFIED
openfix.append ydhs_k_A = yd_hs_A/pds_A - v_A(-1)*d(pds_A)/pds_A
' Real Haig-Simons disposable income in Country B - eq. 12.36 MODIFIED
openfix.append ydhs_k_B = yd_hs_B/pds_B - v_B(-1)*d(pds_B)/pds_B
' Real consumption in country A - eq. 12.37
openfix.append c_k_A = alpha1_A*ydhse_k_A + alpha2_A*v_k_A(-1)
' Real consumption in Country B - eq. 12.38
openfix.append c_k_B = alpha1_B*ydhse_k_B + alpha2_B*v_k_B(-1)
' Expected real Haig-Simons disposable income in country A - eq. 12.39
openfix.append ydhse_k_A = (ydhs_k_A + ydhs_k_A(-1))/2
' Expected real Haig-Simons disposable income in Country B - eq. 12.40
openfix.append ydhse_k_B = (ydhs_k_B + ydhs_k_B(-1))/2
' Real sales in country A - eq. 12.41
openfix.append s_k_A = c_k_A + g_k_A + x_k_A
' Real sales in Country B - eq. 12.42
openfix.append s_k_B = c_k_B + g_k_B + x_k_B
' Value of sales in country A - eq. 12.43
openfix.append s_A = s_k_A*ps_A
' Value of sales in Country B - eq. 12.44
openfix.append s_B = s_k_B*ps_B
'Basic Price of made in Britain goods NEW - eq. 12.44,5
openfix.append p_madeA = (1 + phi_A)*(w_A*n_A)/y_k_A
'Basic Price of made in Country B goods NEW - eq. 12.44,6
openfix.append p_madeB = (1 + phi_B)*(w_B*n_B)/y_k_B
' Price of sales in country A - eq. 12.45 MODIFIED
openfix.append ps_A = (p_madeA*(s_k_A - im_k_A - x_k_A)/s_k_A)+px_A*(x_k_A/s_k_A)+pm_A*(im_k_A/s_k_A)
' Price of sales in Country B - eq. 12.46 MODIFIED
openfix.append ps_B = (p_madeB*(s_k_B-im_k_B-x_k_B)/s_k_B)+px_B*(x_k_B/s_k_B)+pm_B*(im_k_B/s_k_B)
' Price of domestic sales in country A - eq. 12.47
openfix.append pds_A = (s_A - x_A)/(s_k_A - x_k_A)
' Price of domestic sales in Country B - eq. 12.48
openfix.append pds_B = (s_B - x_B)/(s_k_B - x_k_B)
' Domestic sales in country A - eq. 12.49
openfix.append ds_A = s_A - x_A
' Domestic sales in Country B - eq. 12.50
openfix.append ds_B = s_B - x_B
' Real domestic sales in country A - eq. 12.51
openfix.append ds_k_A = c_k_A + g_k_A
' Real domestic sales in Country B - eq. 12.52
openfix.append ds_k_B = c_k_B + g_k_B
' Value of output in country A - eq. 12.53
openfix.append y_A = s_A - im_A
' Value of output in Country B - eq. 12.54
openfix.append y_B = s_B - im_B
' Value of real output in country A - eq. 12.55
openfix.append y_k_A = s_k_A - im_k_A
' Value of real output in Country B - eq. 12.56
openfix.append y_k_B = s_k_B - im_k_B
' Price of output in country A - eq. 12.57
openfix.append py_A = y_A/y_k_A
' Price of output in Country B - eq. 12.58
openfix.append py_B = y_B/y_k_B
' Consumption in country A - eq. 12.59
openfix.append cons_A = c_k_A*pds_A
' Consumption in Country B - eq. 12.60
openfix.append cons_B = c_k_B*pds_B
' Government expenditure in country A - eq. 12.61
openfix.append g_A = g_k_A*pds_A
' Government expenditure in Country B - eq. 12.62
openfix.append g_B = g_k_B*pds_B
' Note: tax definitions in the book as eqns 12.63 & 12.64 are already as eqns 12.7 & 12.8
' Employment in country A - eq. 12.65
openfix.append n_A = y_k_A/pr_A
' Employment in Country B - eq. 12.66
openfix.append n_B = y_k_B/pr_B
' ASSET DEMANDS
' Demand for country A bills in country A - eq. 12.67
openfix.append b_AA_d = v_A*(lambda10 + lambda11*r_A - lambda12*(r_B + dxre_B))
' Demand for Country B bills in country A - eq. 12.68
openfix.append b_AB_d = v_A*(lambda20 - lambda21*r_A + lambda22*(r_B + dxre_B))
' Holding of money in country A - eq. 12.69 MODIFIED
openfix.append h_A_h = v_A - b_AA_s - (b_AB_s*xr_B)
' Demand for US bills in Country B - eq. 12.70
openfix.append b_BB_d = v_B*(lambda40 + lambda41*r_B - lambda42*(r_A + dxre_A))
' Demand for country A bills in Country B - eq. 12.71
openfix.append b_BA_d = v_B*(lambda50 - lambda51*r_B + lambda52*(r_A + dxre_A))
' Holding of money in Country B - eq. 12.72 MODIFIED
openfix.append h_B_h = v_B - b_BB_s - (b_BA_s*xr_A)
' Note - we follow eqns numbering in the text...
' Expected change in country A exchange rate - eq. 12.75
' openfix.append dxre_A = (xre_A - xr_A(-1))/xr_A
' Expected change in Country B exchange rate - eq. 12.76
' openfix.append dxre_B = (xre_B - xr_B(-1))/xr_B
' ASSET SUPPLIES
' Suply of cash in Country B - eq. 12.77 MODIFIED
openfix.append h_B_s = h_B_h
' Supply of Country B bills to Country B - eq. 12.78
openfix.append b_BB_s = b_BB_d
' Supply of Country B bills to Country B Central bank - eq. 12.79
openfix.append b_cb_BB_s = b_cb_BB_d
' Suply of cash in country A - eq. 12.80 MODIFIED
openfix.append h_A_s = h_A_h
' Bills issued by Country B acquired by Country B - eq. 12.81
openfix.append b_AA_s = b_AA_d
' Supply of country A bills to country A Central bank - eq. 12.82
' MODLER MACRO VERSION
openfix.append b_cb_AA_s = b_cb_AA_d
' BOOK VERSION - eq. 12.82A
' openfix.append b_cb_AA_s = b_A_s - b_AA_s - b_BA_s
' Balance sheet of Country B Central bank - eq. 12.83 - expressed as changes
openfix.append b_cb_BB_d = b_cb_BB_d(-1) + d(h_B_s) - d(or_B)*pg_B
' Balance sheet of Country A Central bank - eq. 12.84
openfix.append b_cb_AA_d = b_cb_AA_d(-1) + d(h_A_s) - d(b_cb_AB_s)*xr_B - d(or_A)*pg_A
' Price of gold is equal in the two countries - eq. 12.85
openfix.append pg_A = pg_B/xr_A
' Country B exchange rate - eq. 12.86
openfix.append xr_B = 1/xr_A
' Equilibrium condition for bills issued by Country A acquired by Country B - eq. 12.87
openfix.append b_BA_s = b_BA_d*xr_B
' Equilibrium condition for bills issued by Country B acquired by Country A Central bank - eq. 12.88
openfix.append b_cb_AB_d = b_cb_AB_s*xr_B
' Country A Exchange rate - eq. 12.89FL - xr_A is now exogenous
' openfix.append xr_A = b_AB_s/b_AB_d
' Bills supply from Country A to Country B - eq. 12.89F
openfix.append b_AB_s = xr_A*b_AB_d
' Supply of Country A bills to CountryS, now solved for b_cb_AB_s - eq. 12.90F
openfix.append b_cb_AB_s = b_B_s - b_BB_s - b_cb_BB_d - b_AB_s
' Government deficit in Country A
openfix.append psbr_A = g_A + r_A(-1)*b_A_s(-1) - t_A - f_cb_A
' Government deficit in Country B
openfix.append psbr_B = g_B + r_B(-1)*b_B_s(-1) - t_B - f_cb_B
' Net accumulation of financial assets in Country A
openfix.append nafa_A = psbr_A + cab_A
' Net accumulation of financial assets in Country B
openfix.append nafa_B = psbr_B + cab_B
'End of the model
smpl 1952 @last
' Select the baseline Scenario
openfix.scenario Baseline
openfix.solve(i=p)
'CREATE NEW SHOCKS ON PASS-THROUGH COEFFICIENTS
'1. VERY LOW PASS-THROUGH
openfix.scenario "Scenario 1"
openfix.override nu1x nu1m
copy nu1x nu1x_1
copy nu1m nu1m_1
smpl 2020 @last
nu1x_1 = 0.7 'from 0.5
nu1m_1 = 0.3 'from 0.7
smpl @all
openfix.solve
'2. LOW PASS-THROUGH
openfix.scenario(n) "Scenario 2"
openfix.override nu1x nu1m
copy nu1x nu1x_2
copy nu1m nu1m_2
smpl 2020 @last
nu1x_2 = 0.6 'from 0.5
nu1m_2 = 0.4 'from 0.7
smpl @all
openfix.solve
'3. FAIRLY LOW PASS-THROUGH
openfix.scenario(n) "Scenario 3"
openfix.override nu1x nu1m
copy nu1x nu1x_3
copy nu1m nu1m_3
smpl 2020 @last
nu1x_3 = 0.4 'from 0.5
nu1m_3 = 0.6 'from 0.7
smpl @all
openfix.solve
'4. FAIRLY HIGH PASS-THROUGH
openfix.scenario(n) "Scenario 4"
openfix.override nu1x nu1m
copy nu1x nu1x_4
copy nu1m nu1m_4
smpl 2020 @last
nu1x_4 = 0.3 'from 0.5
nu1m_4 = 0.7 'from 0.7
smpl @all
openfix.solve
'5. HIGH PASS-THROUGH
openfix.scenario(n) "Scenario 5"
openfix.override nu1x nu1m
copy nu1x nu1x_5
copy nu1m nu1m_5
smpl 2020 @last
nu1x_5 = 0.2 'from 0.5
nu1m_5 = 0.8 'from 0.7
smpl @all
openfix.solve
'6. VERY HIGH PASS-THROUGH
openfix.scenario(n) "Scenario 6"
openfix.override nu1x nu1m
copy nu1x nu1x_6
copy nu1m nu1m_6
smpl 2020 @last
nu1x_6 = 0.1 'from 0.5
nu1m_6 = 0.9 'from 0.7
smpl @all
openfix.solve
'7. ML CONDITION
openfix.scenario(n) "Scenario 7"
openfix.override nu1x nu1m
copy nu1x nu1x_7
copy nu1m nu1m_7
smpl 2020 @last
nu1x_7 = 0 'from 0.5
nu1m_7 = 1 'from 0.7
smpl @all
openfix.solve
'8. Exchange rate devaluation (for country A)
openfix.scenario(n) "Scenario 8"
openfix.override xr_A
copy xr_A xr_A_8
smpl 2020 @last
xr_A_8 = 0.99 'from 1