Linear DSGE Examples
Posted: Fri Jul 03, 2009 2:12 pm
The following is an updated set of examples that we had written to be solved with the old DSGE toolkit. These are all examples of relatively simply linear models with rational expectations. The main interest here is showing how to create variables to handle expectations given information sets other that t. (Many of these models have at least some terms which are expectations given t-1.).
Code: Select all
*
* All examples are from Minford and Peel, "Advanced Macroeconomics, A Primer",
* Edward Elgar, 2002.Rational Expectations
*
* Model I
* Minford and Peel, p 44
*
* m = m0 + eps
* m = p + y
* p = E(p(t)|t-1) + delta(y-y*)
*
* The variable set is augmented to include w=Ep(t+1)|t. The expectation term in
* the third equation is then w{1}.
*
dec real delta ystar m0
dec series m p y w z r
*
frml eqn1 = m - m0
frml(identity) eqn2 = m - (p+y)
frml(identity) eqn3 = p - (w{1}+delta*(y-ystar))
frml(identity) eqn4 = w - p{-1}
group model1 eqn1 eqn2 eqn3 eqn4
*
compute delta=0.3,ystar=100.0,m0=10.0
dsge(model=model1,a=adlm,f=fdlm,z=zdlm) m p y w
*
* Model II
* Minford and Peel, p 49
*
* m = m0 + eps
* m = p + y - alpha*(E(p(t+1)|t-1)-E(p(t)|t-1))
* p = E(p(t)|t-1)+delta(y-y*)
*
* We need to augment here with w=E(p(t+1)|t) and z=E(p(t+2)|t).
*
dec real delta ystar m0 alpha
dec series m p y w z
frml eqn1 = m - m0
frml(identity) eqn2 = m - (p+y-alpha*(z{1}-w{1}))
frml(identity) eqn3 = p - (w{1}+delta*(y-ystar))
frml(identity) eqn4 = w - p{-1}
frml(identity) eqn5 = z - w{-1}
group model2 eqn1 eqn2 eqn3 eqn4 eqn5
compute delta=0.3,ystar=100.0,m0=10.0,alpha=0.1
dsge(model=model2,a=adlm,f=fdlm,z=zdlm) m p y w z
*
* Model III
* Minford and Peel, p 61
*
* m = m0+eps
* m = p + y - alpha*(E(p(t+1)|t)-p)
* y-ystar=mu*(y(t-1)-ystar)+(1.0/delta)*(p(t)-E(p(t)|t-1)
* Augment with w=E(p(t+1)|t)
*
dec real alpha delta mu ystar m0
dec series m p y w
*
frml eqn1 = m - m0
frml(identity) eqn2 = m - (p+y-alpha*(p{-1}-p))
frml(identity) eqn3 = y - (ystar+lambda*(y{1}-ystar)+(1.0/delta)*(p-w{1}))
frml(identity) eqn4 = w - p{-1}
group model3 eqn1 eqn2 eqn3 eqn4
compute delta=0.3,mu=0.8,alpha=0.1,ystar=100.0,m0=10.0
dsge(model=model3,a=adlm,f=fdlm,z=zdlm) m p y w
*
* Model IV
* Minford and Peel, page 109
*
* y = -alpha*(R-E(p(t+1)|t-1)+E(p(t)|t-1))+muf*(y(t-1)-ystar)
* y = ystar + beta*(p-E(p(t)|t-1))
* m = p + y - cR + eps1
* m = m0 + rhomu*(y{1}-y*) + eps2
*
* Augment with w=E(p(t+1)|t) and z=E(p(t+2)|t)
*
dec real alpha beta muf rhomu c m0 ystar
dec series m p y r w z
*
frml(identity) eqn1 = y - (-alpha*(r-z{1}+w{1})+muf*(y{1}-ystar))
frml(identity) eqn2 = y - (ystar+beta*(p-w{1}))
frml eqn3 = m - (p+y-c*R)
frml eqn4 = m - (m0+rhomu*(y{1}-ystar))
frml(identity) eqn5 = w - p{-1}
frml(identity) eqn6 = z - w{-1}
group model4 eqn1 eqn2 eqn3 eqn4 eqn5 eqn6
compute ystar=100.0,m0=10.0,alpha=.2,muf=-.3,beta=.1,c=2.0,rhomu=-.6
dsge(model=model4,a=adlm,f=fdlm,z=zdlm) m p y r w z