# Models

- One equation rational expectations model (\prg4\taylor1.prg)

## One equation rational expectations model (Taylor 1993)

The following program replicates Figure 1-1 (p.14) from Taylor (1993) Macroeconomic Policy in a World Economy, Norton. The model is the simplest possible rational expectations model where real money demand depends on expected inflation.

    'solution of forward looking model
    'replicates simple one equation model in
    'Taylor (1993) "Macroeconomic Policy in a World Economy,"
    'Figure 1-1, p.14
    'version 4
    'last updated 10/11/2000 h.

    workfile taylor1 u 1 30

    'set adjustment parameter
    !beta = 0.5
    'set AR(1) parameter for monetary shock
    !rho = 0.8
    'set lag for anticipated shock
    !lag = 10
    'axis label graph
    !x0 = !lag + 1

    'endogenous series
    series pt = 0
    'exogenous shock
    series mt

    'specify model
    model mod1
    mod1.append -pt + mt = -!beta*(pt(+1) - pt)

    'case (1): unanticipated temporary shock
    mt = 0
    smpl @first @first
    mt = 1
    smpl @all
    mod1.solve
    'plot response
    series pt_1 = pt_0
    pt_1.displayname Unanticipated temporary shock
    graph graph1.line pt_1

    'case (2): unanticipated geometric shock
    mt = 0
    smpl @first @first
    mt = 1
    smpl @first+1 @last
    mt = !rho*mt(-1)
    smpl @all
    mod1.solve
    'plot response
    series pt_2 = pt_0
    pt_2.displayname Unanticipated gradual shock
    graph graph2.line pt_2

    'case (3): anticipated temporary shock
    mt = 0
    smpl @first+!lag @first+!lag
    mt = 1
    smpl @all
    mod1.solve
    'plot response
    series pt_3 = pt_0
    pt_3.displayname Anticipated temporary shock
    graph graph3.line pt_3
    graph3.draw(line,bottom,rgb(128,128,128)) !x0

    'case (4): anticipated geometric shock
    mt = 0
    smpl @first+!lag @first+!lag
    mt = 1
    smpl @first+!lag+1 @last
    mt = !rho*mt(-1)
    smpl @all
    mod1.solve
    'plot response
    series pt_4 = pt_0
    pt_4.displayname Anticipated gradual shock
    graph graph4.line pt_4
    graph4.draw(line,bottom,rgb(128,128,128)) !x0

    'combine graphs
    freeze(g1) graph1 graph2 graph3 graph4
    g1.setelem(1) lpat(solid) symbol(circle)
    g1.scale(left) range(0,1)
    g1.addtext(t) Effect of shocks in forward looking models (Taylor Figure 1-1, p.14)
    'g1.legend -inbox position(1.2,0)
    g1.align(2,1.0,1.0)
    show g1