8 Things To Know

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/5144373

Teaching Macroeconomics with GAMS

Article  in  Computational Economics · February 1998


DOI: 10.1023/A:1008649615981 · Source: RePEc

CITATIONS READS
17 286

3 authors, including:

Hans M Amman Ruben Mercado


University of Amsterdam United Nations Development Programme, Argentina
117 PUBLICATIONS   652 CITATIONS    31 PUBLICATIONS   76 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Approximating the Value Function for Optimal Experimentation View project

All content following this page was uploaded by Hans M Amman on 29 May 2014.

The user has requested enhancement of the downloaded file.


1

TEACHING MACROECONOMICS WITH GAMS

P. Ruben Mercado

David Kendrick

and

Hans Amman*

University of Texas, Austin

* University of Amsterdam, Amsterdam

Department of Economics
The University of Texas at Austin
Austin, TX, May 1997
2

The teaching of macroeconomics at both undergraduate and graduate levels has


recently began to incorporate computational tools. Some textbooks come accompanied by

A Primer on GAMS Programming


1
See Brooke et al., 1992, or the GAMS home page on the Internet: http://www.gams.com/
3

Suppose that we want to solve the simple macroeconomic model shown below:

y= c+i
c = ay + b
i = 100

where y = income, c = consumption, i = investment, a = 0.8 and b = 200. The GAMS


statement for this problem would be:

$ TITLE SIMPLE MODEL EXAMPLE


SCALARS
a marginal propensity to consume / 0.8 /
b minimum consumption level / 200 / ;

PARAMETERS
i investment ;
i = 100;

VARIABLES
y income
c consumption
j performance index

EQUATIONS
eq1 first equation
eq2 second equation
eqj performance index eq ;

eqj.. j =E= 0;
eq1.. y =E= c + i;
eq2.. c =E= a * y + b;

MODEL SIMPLE / eqj, eq1, eq2 /;

SOLVE SIMPLE MINIMIZING j USING LP;

DISPLAY y.l, c.l;

This is a typical structure of a GAMS program. We define scalars, parameters,


variables and equations,2 we name the model3 and tell GAMS its component equations,
and we then ask GAMS to solve it using an appropriate method - for this case, Linear
Programming (LP), since the model is linear. Finally, we ask GAMS to display the
solution values.4

3
4
4

Dynamic Deterministic Nonlinear Model with Backward Looking Expectations 5

7
i-v ix-x
vi-viii
xi xii

v viii ix x

Equations
i) GDP identity
Y = C+ I+ G+X
ii) Disposable Income
Yd = (1- t) Y
iii) Consumption
C = a + b Yd
iv) Investment
I = e-dR
v) Money Demand
M/P = k Y - h R
vi) Expected Inflation
e
= -1 + -2
vii) Inflation Rate
e
= + f {(Y-1 - YN) / YN}
viii) Price Level
P = P-1 (1 + )
ix) Real Exchange Rate
E P / Pw = q + v R
x) Net Exports
X = g - m Y - n E P / Pw
xi) Government Deficit
Gd = G - t Y

(.up) and its marginal or dual value (.m). Since our values of interest in this example are the levels of x
and y, we display them as x.l and y.l respectively.
5
There are two programs containing the GAMS representation of this model. One program is for
simulation (TM1SIM.GMS) and the other for policy analysis (TM1POL.GMS). Both programs will be
available from http://www.fee.uva.nl/vak_groep/macro/amman/htm. Program TM1SIM.GMS is also in
Appendix 1 of this article.
6
See Hall and Taylor, 1993. Though its building blocks are developed throughout the book, the whole
7
5

xii) Unemployment Rate


U = UN - {(Y - YN) / YN}

Endogenous Variables Policy Variables


C: Consumption G: Government Expenditure
E: Nominal Exchange Rate M : Money Stock
Gd : Government Deficit
I: Investment
P: Domestic Price Level Exogenous Variables
R: Real Interest Rate
U: Unemployment Rate Pw : Foreign Price Level
X: Net Exports UN
N
d

a= b= d= e= f = g= h= k=
m= n= q= t= v= ; = = =

Different strategies can be followed when one is confronted with the problem of
solving and performing policy experiments with a model like this.8 In the following, we
will review some of them.

8
Models with backward looking expectations, as the one we are dealing with in this section, are also
6

VARIABLES
Y(t) gdp
Yd(t) disposable income

10

9
To avoid notational conflicts in the GAMS statement, parameters e, g, m and t have been renamed as
ee, gg, mm and tax, respectively.
10
To learn more about temporal specifications in GAMS, read Brooke et al. (1992), Chapter 12. Also see
7

t = {0,1,2,3}

eq(t).. w(t) =E= z(t-1)

eq(0).. w(0) =E= 0;


eq(1).. w(1) =E= z(0);
eq(2).. w(2) =E= z(1);
eq(3).. w(3) =E= z(2);

11

---- EQ6 =E= expected inflation

EQ6(2).. - 0.2*PI(0) - 0.4*PI(1) + PIEX(2) =E= 0 ;

EQ6(3).. - 0.2*PI(1) - 0.4*PI(2) + PIEX(3) =E= 0 ;

EQ6(4).. - 0.2*PI(2) - 0.4*PI(3) + PIEX(4) =E= 0 ;


11
See Chapter 12 in Brooke et al., 1992.
8

EQ6(5).. - 0.2*PI(3) - 0.4*PI(4) + PIEX(5) =E= 0 ;

EQ6(6).. - 0.2*PI(4) - 0.4*PI(5) + PIEX(6) =E= 0 ;

Notice that eq6(t+2) goes from periods 2 to 6, while pi(t) goes from 0 to 4, pi(t+1)
from 1 to 5, and piex(t+2) from 2 to 6. This means that the effective solution horizon for

SETS t EXTENDED HORIZON / 0*6 /


t0(t) PERIOD ZERO
t1(t) PERIOD ONE;
t0(t) = YES$(ORD(t) EQ 1);
t1(t) = YES$(ORD(t) EQ 2);

12

Y.fx(t1) = ini1; Pi.fx(t0) = ini2; Pi.fx(t1) = ini3;

12
In the same way, we can also define terminal conditions subsets. These conditions become necessary
in models containing rational expectations, as we will see later. For instance, terminal conditions for the
last and the previous to the last period could be written by defining two new subsets - for example, tf(t)
9

To perform simulations with this model we just have to change the values of the
policy and/or exogenous variables or the parameter values, and compare the different
dynamic solution paths obtained for the endogenous variables.

Where GAMS reveals itself as a very powerful tool is in optimal policy analysis.
This analysis is, in a way, the reverse of simulation. Instead of determining the paths of the
endogenous variables given values for the policy variables, we now want to determine the
optimal path for the policy variables given target paths and relative weights for target
variables. This can be easily done by adding a loss function as an extra equation to the
model and by redefining the policy variables of interest as endogenous variables. For
example, in the GAMS statement above, we can add the following quadratic loss function:

eqLoss.. Loss =E= 0.5 * sum(t, Wy * POWER((Y(t)-Ytar(t)), 2 ) + Wp * POWER((P(t)-Ptar(t)), 2 );

where Ytar and Ptar are pre-specified target values for output and the price level, and
where Wy and Wp are weights on the deviations from target values of output and the
price level respectively.13

If we now redefine, for example, parameter M(t) as an endogenous variable, and

Dynamic Stochastic Linear Model with Rational Expectations14

15

16

13
Since the variables entering the loss function (GDP and the price level) are measured in different units,
it is convenient to impose some normalization on the weights. For instance, if Ytar = 6000 and Ptar = 1,
to equally penalize deviations from target we could set Wy = 1, and then obtain the corresponding
normalized Wp as:
Wp = 60002 / 12 = 3600000
Then, if we decide to care about deviations from Ytar twice as much as for deviations from Ptar, we will
choose Wy = 2 and Wp = 3600000, or Wy = 1 and Wp = 1800000, etc. For a full discussion of weighting
procedures see Park (1997).
14
There are two programs containing the GAMS representation of this model. One program is for
simulation (TM2SIM.GMS) and the other for policy analysis (TM2POL.GMS). Both programs will be
available from http://www.fee.uva.nl/vak_groep/macro/amman/htm. Program TM2POL.GMS is also in
Appendix 2 of this article.
15
See Taylor (1993), Chapter 1. Earlier versions of this model can be found in Carlozzi and Taylor
(1985), which contains extended explanations of its inner workings, and in Taylor (1985), which also
contains policy coordination experiments in a difference games framework.
16
These models are also presented in Taylor (1993).
10

17

Equations
2 2 2
1 A) xt = 3
wt +i + 1
3
pt +i + 3
yt +i
i =0 i =0 i =0
2
2 A) wt = 1
3
xt i
i=0
3A) pt = wt
4A) yt = d rt
5A) mt pt = b it + a yt
6 A) rt = i t pt +1 + p t

Variables

xt = contract wage
wt = average wage
pt = price level (the expected inflation rate is defined as t = pt +1 pt )
yt = output
it = nominal interest rate
rt = real interest rate
mt = money stock

a b d

This is a linear model in which all the variables - except the inflation and interest
rates - are logarithms and are deviations from means or secular trends. This way of
expressing variables is a common practice in empirical macroeconomics. It facilitates the
work of econometric estimation and the analysis of results, since all variables are
expressed in percentage points.18

17
For a detailed presentation of each of the equations you are referred to Taylor (1993).
18
For a practical introduction to linearization techniques, see Mercado and Kendrick (1997). For an
extended treatment of this topic, see Amman and Kendrick (1996); Dixon et al. (1992), Chapter 3; and
Kendrick (1990), Chapter 4.
11

19

20

21

19
For an extended coverage of this kind of methods, see Azariadis (1993), Blanchard and Khan (1980),
Wallis (1980) and Pesaran (1987).
20
See Hughes-Hallet and Rees (1983).
21
12

22

23

24

25
26

VARIABLES
x(t) contract wage
w(t) average wage

22
23

24

25
26
13

EQUATIONS
eq1x(t) staggered wage-setting
eq2w(t) average wage

27

eq2w(t).. w(t) =E= (1/3) * x(t) + (1/3) * x(t-1) + (1/3) * x(t-2) ;

27
As in the previous section, it is recommended to set the GAMS OPTION LMROW equal to the
14

instead of using t, t+1 and t+2 indices, it will be troublesome to properly assign the
corresponding initial values for x(t-1) and x(t-2) and to interpret the solution values of the
model for the first two periods. Also, if we write:

eq1x(t+2).. x(t+2) =E= (del/3) * w(t+2) + (del/3) * w(t+3) + (del/3) * w(t+4)


+ ((1-del)/3) * p(t+2) + ((1-del)/3) * p(t+3) + ((1-del)/3) * p(t+4)

+ (gam/3) * y(t+2) + (gam/3) * y(t+3) + (gam/3) * y(t+4) ;

instead of using the index t+4 for eq1x(.), it will be troublesome to properly assign the
corresponding terminal values for w(t+3), w(t+4), p(t+3), p(t+4), y(t+3) and y(t+4) and to
interpret the solution values of the model for the last two periods.

28

contract wage: x.fx(t0) = ini1; x.fx(t1) = ini2;

average wage: w.fx(tf) = wss.l; w.fx(tf1)= wss.l;


price level: p.fx(tf) = pss.l; p.fx(tf1) = pss.l;
GDP: y.fx(tf) = yss.l; y.fx(tf1) = yss.

28
See Azariadis (1993), Chapter 4.
15

29
where

30

rt = ar pt

31

29
See note 9.
30
See Kydland and Prescott (1977), and Taylor (1993).
31
If we are interested in comparing the performance of different rules, we will have to make sure that
16

Below is a GAMS statement for 10 Monte Carlo runs. In these simulations we


generate serially uncorrelated and independently normally distributed disturbances with
mean zero and standard deviations equal to 0.1, and compute the average standard
deviation of GDP and the price level for the 10 Monte Carlo runs.32

SCALARS
vary variance of GDP /0/
varp variance of the price level /0/
acvary accumulated variance of GDP /0/
acvarp accumulated variance price level /0/
avstdy average std. deviation of GDP /0/
avstdp average std. deviation of the price level /0/

SETS
k index for Monte Carlo runs / 1*10 /;

LOOP(k,
vary = 0; varp = 0;
shock(t) = normal(0, 0.1);

SOLVE taylorre MAXIMIZING J1 USING LP;

vary = (sum(te, y.l(te) * y.l(te) )) / 7;


varp = (sum(te, p.l(te) * p.l(te) )) / 7;
acvary = acvary + vary;
acvarp = acvarp + varp
);
avstdy = sqrt(acvary / 10) ;
avstdp = sqrt(acvarp / 10) ;

Notice that the shocks are transitory and with zero mean. Then, the steady-state of
the model will not be affected by them, and neither will be the terminal conditions.

Concluding Comments

As we said at the beginning, the teaching of economics, and of macroeconomics in


particular, is beginning to make more use of computational tools. This practice is likely to
increase exponentially in the near future. As one of the most powerful and widely used
programming languages in economics, GAMS offers a relatively easy way of performing
simulation and policy analysis with a wide variety of dynamic macroeconomic models.
The initiation costs for the beginner are relatively low, and the transition for more
experienced users easy. It is mainly a matter of understanding the principles of solutions
methods for problems involving boundary conditions, and of learning how to properly
handle the definition of time indexes for variables and equations.

32
Notice that there is no semicolon between the final statement in the LOOP and the parenthesis that
closes it.
17

Appendix 1

$TITLE TM1SIM: HALL-TAYLOR SIMULATION


OPTION SYSOUT = OFF;
OPTION LIMROW = 0;
OPTION LIMCOL = 0;
OPTION SOLPRINT = OFF;
$OFFSYMXREF OFFSYMLIST
***********************************************************************
* This program takes as reference the model:
* "agg. demand / price adj. open economy flexible exchg. rate"
* as it is defined in Robert Hall and John Taylor’s "MACROSOLVE",
* the software accompaning their "Macroeconomics" book
* (fourth edition, 1993)
***********************************************************************
* This program has 4 sections
* You are encouraged to modify the values of
* policy variables, exogenous variables and structural parameters
*
* The results of your interest will be at the end of GAMS’ output,
* in Reports containing simulations’ results
*
* Section 1: definition of parameter values for the original
* nonlinear Hall-Taylor model
* Section 2: definition of temporal horizon for simulation
* Section 3: definition of changes in policy and in exogenous variables
* Section 4: computation of solution
***********************************************************************
***********************************************************************
*
* SECTION 1 : DEFINITION OF PARAMETER VALUES FOR THE ORIGINAL
* NONLINEAR HALL-TAYLOR MODEL
*
***********************************************************************
SCALARS

a minimum consumption / 220 /


b marg prop to consume / 0.7754 /
d maximum investment / 2000 /
ee interest elast of invest. / 1000 /
f coeff. on excess aggr dem. / 0.8 /
gg maximum net exports / 600 /
h interest elast of mon dem. / 1000 /
k income elast of money dem. / 0.1583 /
mm income elast of net exp / 0.1 /
n real ex rate elast of net exp / 100 /
q constant / 0.75 /
tax tax rate / 0.1875 /
v constant /5/
alpha coeff. on 1 lagged inflation / 0.4 /
beta coeff. on 2 lagged inflation / 0.2 /
mu elast. of empl. w.r.t GDP / 0.33 / ;
***********************************************************************
* SECTION 2: DEFINITION OF TEMPORAL HORIZON FOR SIMILATION
***********************************************************************
* If you change the extension of the horizon, make the necessary
* adjustments in the section of shocks’ definition (Section 3)
18

SETS T EXTENDED HORIZON / 0*15 /


T0(T) PERIOD ZERO
T1(T) PERIOD ONE ;

T0(T) = YES$(ORD(T) EQ 1);


T1(T) = YES$(ORD(T) EQ 2);
DISPLAY T0, T1;
***********************************************************************
* SECTION 3 : DEFINITION OF CHANGES IN POLICY AND IN EXOGENOUS VARIABLES
***********************************************************************
PARAMETERS
* definition of policy and exogenous variables (in percentage changes)
Mper(T) money stock (in % change)
Gper(T) Gov. expenditure (in % change)
Ynper(T) potential GDP (in % change)
Pwper(T) foreign prices (in % change)

* definition of policy and exogenous variables (in levels)


M(T) money stock (in levels)
G(T) Gov. expenditure (in levels)
Yn(T) potential GDP (in lveels)
Pw(T) foreign prices (in levels) ;
* default values for policy and exogenous variables
Mper(T) = 0 ; Gper(T) = 0 ; Ynper(T) = 0 ; Pwper(T) = 0 ;
M(T) = 900 ; G(T) = 1200 ; Yn(T) = 6000 ; Pw(T) = 1 ;
***********************************************************************
* Changes in policy and in exogenous variables
*
* You can modify the values of the policy and/or the exogenous
* variables. You have to define the modifications in % changes. Their
* equivalent in levels are automatically computed (these are used in
* the simulation of the nonlinear dynamic model)
* For example, to increase the money supply by 3%, change the
* expression below from Monper(TS1) = 0.0 to Monper(TS1) = 0.03
*
* You can also modify the duration of the modifications
* If you do so, the modifications will have to be compatible with the
* simulation horizon defined in Section 2
* Default modifications start in period 4, for you to contrast
* the changes introduced by your experiments with the previous steady-
* state of the system
*
* You can define as many modifications as you want, following
* the format below
*
* You can modify the money supply, gov. expenditure,
* potential GDP and the foreign price.
***********************************************************************
******************************
* CHANGE IN MONEY SUPPLY
******************************
SETS
TS1(T) periods for shock 1 / 4*15 / ;
Mper(TS1) = 0.0 ;
****************************************
* CHANGE IN GOVERNMENT EXPENDITURE
****************************************
SETS
TS2(T) periods for shock 2 / 4*15 / ;
Gper(TS2) = 0.0;
19

***********************************************************
* CHANGE IN POTENTIAL GNP (notice that the natural rate of
* unemployment remains the same)
***********************************************************
SETS
TS3(T) periods for shock 3 / 4*15 / ;
Ynper(TS3) = 0.0;

****************************
* CHANGE IN FOREIGN PRICES
****************************
SETS
TS4(T) periods for shock 4 / 4*15 / ;
Pwper(TS4) = 0.0;
* Transformation of shocks in % changes into shocks in levels
M(TS1) = 900 * (1 + Mper(TS1)) ;
G(TS2) = 1200 * (1 + Gper(TS2)) ;
Yn(TS3) = 6000 * (1 + Ynper(TS3)) ;
Pw(TS4) = 1 * (1 + Pwper(TS4)) ;

* reporting policy and exogenous variables values used for the simulation
PARAMETER REPORTEX POLICY AND EXOGENOUS VARIABLES VALUES;
REPORTEX(T,"Money") = M(T);
REPORTEX(T,"Gov. Exp.") = G(T);
REPORTEX(T,"Pot. GDP") = Yn(T);
REPORTEX(T,"Fgn Price") = Pw(T);

***********************************************************************
* SECTION 4: COMPUTATION OF SOLUTION
***********************************************************************
PARAMETERS
Un(T) natural rate of unemployment ;
Un(T) = 0.05 ;
VARIABLES
Y(T) gdp
Yd(T) disposable income
C(T) consumption
I(T) investment
R(T) interest rate
P(T) price level
pi(T) inflation rate
piex(T) expected inflation rate
E(T) nominal exchange rate
X(T) net exports
Gd(T) government deficit
U(T) unemployment rate
J2 performance index
EQUATIONS
eq1(T) gdp identity
eq2(T) disposable income
eq3(T) consumption
eq4(T) investment
eq5(T) money demaeq
eq6(T) expected inflation
eq7(T) inflation rate
eq8(T) price level
eq9(T) real exchange rate
eq10(T) net exports
eq11(T) government deficit
20

eq12(T) unemployment rate


JD2(T) performance index ;

JD2(t).. J2 =E= 0 ;
eq1(t+2).. Y(t+2) =E= C(t+2) + I(t+2) + G(t+2) + X(t+2) ;
eq2(t+2).. Yd(t+2) =E= (1 - tax) * Y(t+2) ;
eq3(t+2).. C(t+2) =E= a + b * Yd(t+2) ;
eq4(t+2).. I(t+2) =E= ee - d * R(t+2) ;
eq5(t+2).. M(t+2) / P(t+2) =E= k * Y(t+2) - h * R(t+2) ;
eq6(t+2).. piex(t+2)=E= alpha * pi(t+1) + beta * pi(t) ;
eq7(t+2).. pi(t+2) =E= piex(t+2) + f * (Y(t+1) - Yn(t+2)) / Yn(t+2) ;
eq8(t+2).. P(t+2) =E= P(t+1) * (1 + pi(t+2)) ;
eq9(t+2).. E(t+2) * P(t+2) / Pw(t+2) =E= q + v * R(t+2) ;
eq10(t+2).. X(t+2) =E= gg - mm * Y(t+2) - n * ( E(t+2) * P(t+2) / Pw(t+2)) ;
eq11(t+2).. Gd(t+2) =E= G(t+2) - tax * Y(t+2) ;
eq12(t+2).. U(t+2) =E= Un(t+2) - mu * (Y(t+2) - Yn(t+2)) / Yn(t+2) ;

***********************************************************************
* In what follows, we will assign initial variables’ values and lower bounds
* WARNING: The order of declaration of assignments is very important
* Successive assignments to a same variable undo the previous ones
***********************************************************************
* Guess of initial values for the solution algorithm
* Without them, the problem will be declared "infeasible"
* That is, the algorithm will converge to a solution from some initial
* positions but not from others
* This is common in nonlinear problems
R.L(T+2) = 0.09 ; Y.L(T+2) = 6500 ; E.L(T+2) = 1.2 ; C.L(T+2) = 4500 ;
I.L(T+2) = 900 ; X.L(T+2) = -100 ; Gd.L(T+2) = 75 ; U.L(T+2) = 0.07 ;
Yd.L(T+2) = 4875 ; pi.L(T+2) = 0.1 ; piex.L(T+2) = 0.2 ; P.L(T+2) = 1.1 ;
* lower bound for p, to avoid division by zero
P.LO(T) = 0.0001 ;
* fixing initial steady-state values for lagged endogenous variables
P.FX(T1) = 1 ; pi.FX(T0) = 0 ; pi.FX(T1) = 0 ; Y.FX(T1) = 6000 ;

MODEL NONLDYN /eq1,eq2,eq3,eq4,eq5,eq6,


eq7,eq8,eq9,eq10, eq11, eq12 , JD2 / ;
SOLVE NONLDYN MAXIMIZING J2 USING NLP;
* Reporting solution values
PARAMETER REPORTS SOLUTION VALUES IN LEVELS;
REPORTS(T,"GDP") = Y.L(T);
REPORTS(T,"Inflation") = pi.L(T);
REPORTS(T,"Int.Rate") = R.L(T);
REPORTS(T,"Exch.Rate") = E.L(T);
REPORTS(T,"Gov.Def") = Gd.L(T);
REPORTS(T,"Unemploy") = U.L(T);
* Showing final results
DISPLAY REPORTEX;
DISPLAY REPORTS;
21

Appendix 2

$TITLE TM2POL: TAYLOR CLOSED ECONOMY MODEL - POLICY ANALYSIS


OPTION SYSOUT = OFF;
OPTION LIMROW = 0;
OPTION LIMCOL = 0;
OPTION SOLPRINT = OFF;
$OFFSYMXREF OFFSYMLIST

* This program takes as reference the model developed by John Taylor


* in his book: Macroeconomic Policy in a World Economy, Norton, 1993,
* Chapter 1.

* Stochastic simulation of real interest rate rule. Substituting rule


* r(t)=ar*p(t) into equations 4a and 6a, and making m(t) endogenous.

* Defining real interest rate rules’ parameters


* You are encouraged to modify them to analyze the comparative
* performances of different rules

SCALARS
ar rule parameter / 0.6 / ;

* Defining temporal horizons for simulation


* Extended horizon: 11 periods (from 0 to 10)
* The model contains two lags and two leads. Then, the effective
* solution horizon will contain 7 periods (from 2 to 8)

SETS t EXTENDED HORIZON / 0*10 /


te(t) EFFECTIVE SOLUTION HORIZON / 2*8 /
t0(T) PERIOD ZERO
t1(T) PERIOD ONE
tf1(T) PERIOD PREVIOUS TO FINAL
tf(T) FINAL PERIOD;

t0(T) = YES$(ORD(T) EQ 1);


t1(T) = YES$(ORD(T) EQ 2);
tf1(T) = YES$(ORD(T) EQ (card(T) - 1));
tf(T) = YES$(ORD(T) EQ card(T));

* Defining model’s parameter as in Taylor’s book

SCALARS
del / 0.5 /
gam / 1 /
d / 1.2 /
b / 4 /
a / 1 /;
22

* Defining supply shock which is used later in the Monte Carlo runs
* with the LOOP statement

PARAMETERS
shock(t) ;

* Solving the Dynamic Model

VARIABLES
x(t) contract wage
w(t) average wage
p(t) price level
y(t) GDP
i(t) nominal interest rate
m(t) money supply
j1 performance index

EQUATIONS
eq1ax(t) staggered wage-setting home
eq2aw(t) average wage home
eq3ap(t) mark-up pricing home
eq4ay(t) IS curve home
eq5am(t) LM curve home
eq6ai(t) interest rate home
jd performance index definition ;

jd.. j1 =E= 0 ;

eq1ax(t+4).. x(t+2) =E= (del/3)*w(t+2) + (del/3)*w(t+3) + (del/3)*w(t+4)


+ ((1-del)/3)*p(t+2) + ((1-del)/3)*p(t+3) + ((1-del)/3)*p(t+4)
+ (gam/3)*y(t+2) + (gam/3)*y(t+3) + (gam/3)*y(t+4)
+ shock(t+2) ;

eq2aw(t+4).. w(t+2) =E= (1/3)*x(t+2) + (1/3)*x(t+1) + (1/3)*x(t) ;

eq3ap(t+4).. p(t+2) =E= w(t+2) ;

eq4ay(t+4).. y(t+2) =E= -d * (ar*p(t+2)) ;

eq5am(t+4).. m(t+2) =E= p(t+2) -b*i(t+2) + a*y(t+2);

eq6ai(t+4).. (ar*p(t+2)) =E= i(t+2) - p(t+3) + p(t+2);

* Setting terminal and initial conditions


* Since we are dealing here with temporary shocks with mean zero,
* initial and terminal steady-state values will be the same.

* Terminal conditions
p.fx(tf) = 0 ; p.fx(tf1) = 0 ; w.fx(tf) = 0; w.fx(tf1)= 0;
y.fx(tf)= 0; y.fx(tf1)=0 ;

* Initial conditions
x.fx(t0) = 0; x.fx(t1) = 0;
23

MODEL taylorre / eq1ax, eq2aw, eq3ap, eq4ay, eq5am, eq6ai, jd / ;

* Performing stochastic simulations

* Supply shocks occur continually, are unanticipated and temporary

SCALARS
vary variance of GDP /0/
varp variance of the price level /0/
acvary accumulated variance of GDP /0/
acvarp accumulated variance price level /0/
avstdy average std. deviation of GDP /0/
avstdp average std. deviation of the price level / 0 / ;

SETS
k index for Monte Carlo runs / 1*10 /;

LOOP(k,
vary = 0; varp = 0;
shock(t) = normal(0, 0.1);

SOLVE taylorre MAXIMIZING J1 USING LP;

vary = (sum(te, y.l(te) * y.l(te) )) / 7;


varp = (sum(te, p.l(te) * p.l(te) )) / 7;
acvary = acvary + vary;
acvarp = acvarp + varp;
);

* The closed parenthesis just above is the closing parenthesis for the
* "LOOP" statement above

avstdy = sqrt(acvary / 10) ;


avstdp = sqrt(acvarp / 10) ;

* Displaying results

DISPLAY avstdp, avstdy;


24

Bibliographical References

Amman, H. and D. Kendrick (1995), The DUALI/DUALPC Software for Optimal Control
, Center for Applied Research in Economics, The
University of Texas, TP 92-03.

Annals of Operation Research

Intertemporal Macroeconomics

Econometrica

, The Scientific
Press.

Exchange Rate Management under


Uncertainty

Notes and Problems in


Applied General Equilibrium Analysis

Macroeconomics

), Quantitative Economic Policies and Interactive


Planning: A Reconsideration of the Theory of Economic Policy

Stochastic Control for Economic Models

Models for Analyzing Comparative Advantage

Journal of Political Economy

,
Department of Economics, The University of Texas at Austin.
25

Park, H. J. (1997), A Control Theory Analysis of Macroeconomic Policy Coordination by


the US, Japan and Korea, Ph.D. Dissertation, The University of Texas at Austin.

Pesaran, M. H. (1987), The Limits to Rational Expectations, Basil Blackwell.

Econometrica

European Economic Review

Macroeconomic Policy in a World Economy

Econometrica

View publication stats

You might also like