inflation in DSGE

Discussion of State Space and Dynamic Stochastic General Equilibrium Models

inflation in DSGE

Postby ecrgap » Thu Jan 14, 2010 3:55 pm

Dear Tom

Is there available a code for the calibration of a simple DSGE New Keynesian model for output inflation and the interest rate?
In the forum I can find only codes for RBC models. I need that because I want to see how we introduce the inflation rate into the code.

Thank you very much in advance

Best
ecrgap
 
Posts: 40
Joined: Mon May 25, 2009 10:24 am

Re: inflation in DSGE

Postby TomDoan » Thu Jan 14, 2010 6:20 pm

This is the EHL model. Did you have a different one in mind?

Code: Select all
*
* Model from Erceg, Henderson & Levin(2000), "Optimal monetary policy
* with staggered wage and price contracts," Journal of Monetary
* Economics, vol. 46, no 2, 281-313.
*
dec series g mpl mrs dp dw realw r y
dec series rstar wstar ystar
dec series x u z
*
dec real beta sigma chi alpha thetaW thetaP xiW xiP
dec real ubar zbar xbar kbar
dec real rhox
dec real lbar ybar cbar
dec real kappaP kappaW
*
* Household parameters
*
compute beta      = .99
compute sigma     = 1.5
compute chi       = 1.5
compute ubar      = 0.3163
compute zbar      = 0.03
*
* Production function parameters
*
compute alpha     = .3
compute rhox       = 0.95
compute xbar      = 4.0266
compute kbar      = 30.0*ubar
*
* Calvo process parameters
*
compute thetaW    = 1.0/3.0
compute thetaP    = 1.0/3.0
compute xiW       = .75
compute xiP       = .75

compute eps       = 6.0
compute phi       = 6.0
*
* Policy parameters
*
compute rhor       = 0.9
compute gammapi    = 2.0
compute gammaogap = 0.125
*
compute lbar      = .27
compute ybar      = 10.0*ubar
compute cbar      = ybar
*
* Simplifications depending upon deep parameters
*
compute lcbar     = cbar/(cbar-ubar)
compute lubar     = ubar/(cbar-ubar)
compute llbar     = lbar/(1-lbar-zbar)
compute lzbar     = zbar/(1-lbar-zbar)
compute lambda    = alpha + chi * llbar + (1-alpha) * sigma * lcbar
compute kappaP    = (1-xiP*beta)*(1-xiP)/xiP
compute kappaW    = (1-xiW*beta)*(1-xiW)/(xiW*(1+chi*llbar*((1+thetaW)/thetaW)))
*
frml(identity) eqn1  = g     - (g{-1} - 1.0/(sigma*lcbar)*(r{0}-dp{-1}-rstar{0}))
frml(identity) eqn2  = mpl   - (wstar{0} - alpha/(1+alpha)*g{0})
frml(identity) eqn3  = mrs   - (wstar{0} + (chi*llbar/(1-alpha) + sigma*lcbar)*g{0})
frml(identity) eqn4  = dp    - (beta*dp{-1}+kappaP*(realw-mpl))
frml(identity) eqn5  = dw    - (beta*dw{-1}+kappaW*(mrs-realw))
*
* Pareto optima
*
frml(identity) opt1 = ystar - (((1-alpha)*sigma*lubar/lambda)*u{0}-(1-alpha)*chi*lzbar/lambda*z{0}+(1+chi*llbar)/lambda*x{0})
frml(identity) opt2 = wstar - ((-alpha*sigma*lubar/lambda)*u{0}+alpha*chi*llbar/lambda*z{0}+(chi*llbar+alpha*lcbar)/lambda*x{0})
frml(identity) opt3 = rstar - (sigma*lcbar*(ystar{-1}-ystar)+sigma*lubar*(u{-1}-u))
*
frml(identity) def1  = realw - (realw{1}+dw-dp)
frml(identity) def2  = g     - (y - ystar)
*
* The model above needs to be closed with a rule for setting the interest rate
*
frml(identity) c1   = r     - (rhor*r{1}+(1-rhor)*(gammapi*dp+gammaogap*g))
*
frml           s1    = (x-xbar)-(rhox*(x{1}-xbar))
frml           s2    = (u-ubar)
frml           s3    = (z-zbar)

group dsge eqn1 eqn2 eqn3 eqn4 eqn5 opt1 opt2 opt3 def1 def2 s1 s2 s3 c1
dsge(model=dsge,a=adlm,f=fdlm) g dp dw y mpl mrs realw ystar wstar rstar x u z r
@dlmirf(page=byshock,a=adlm,f=fdlm,$
  shocks=||"Productivity","Consumption","Leisure"||,$
  variables=||"Gap","Price Inflation","Wage Inflation"||)
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: inflation in DSGE

Postby ecrgap » Fri Jan 15, 2010 7:02 am

That is exactly what I had in mind.

I really appreciate
ecrgap
 
Posts: 40
Joined: Mon May 25, 2009 10:24 am

Re: inflation in DSGE

Postby jdacuddy » Tue Feb 02, 2010 5:42 am

Dear Tom,

You asked about other DSGE models. One which is rather prominent is:

Lubik, Thomas A. & Schorfheide, Frank, 2007. "Do central banks respond to exchange rate movements? A structural investigation," Journal of Monetary Economics, vol. 54(4), pages 1069-1087, May 2007

Code exists for this under Dynare (see "http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=1689&p=4228&hilit=lubik#p2925"), but it would be very interesting to compare results and functionality with RATS if you had RATS code for it.

Regards
Prof. J.D.A. Cuddy
Graduate Institute of International Studies
132, rue de Lausanne
CH-1211 Geneva
Switzerland
john.cuddy@graduateinstitute.ch
jdacuddy
 
Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

Re: inflation in DSGE

Postby TomDoan » Tue Feb 02, 2010 8:53 am

You can see how this looks.

Code: Select all
*
* Model from Lubik, Thomas A. & Schorfheide, Frank, 2007. "Do central
* banks respond to exchange rate movements? A structural investigation,"
* Journal of Monetary Economics, vol. 54(4), pages 1069-1087, May 2007
*
dec series y phi r q exch A phistar ystar
dec series er eq eystar ephistar ez
dec real beta tau k alpha rhor rhoq rhoystar rhophistar rhoz gamma1 gamma2 gamma3
*
compute beta=0.96
compute tau=0.5
compute k=0.5
compute alpha=0.10
compute rhor=0.5
compute rhoq=0.4
compute rhoystar=0.9
compute rhophistar=0.8
compute rhoz=0.2
compute gamma1=1.5
compute gamma2=0.25
compute gamma3=0.25
frml(identity) eqn1 = y - (y{-1}-(tau+alpha*(2-alpha)*(1-tau))*(r-phi{-1})-rhoz*(A-A{1})-$
   alpha*(tau+alpha*(2-alpha)*(1-tau))*q{-1}+alpha*(2-alpha)*((1-tau)/tau)*(ystar))
frml(identity) eqn2 = phi - (beta*phi{-1}+alpha*beta*q{-1}-(alpha*q)+(k/(tau+alpha*(2-alpha)*(1-tau)))*$
     (y+alpha*(2-alpha)*((1-tau)/tau)*ystar))
frml(identity) eqn3 = r - (rhor*r{1}+(1-rhor)*(gamma1*phi+gamma2*y+gamma3*exch)+er)
frml(identity) eqn4 = exch - (phi-(1-alpha)*q-phistar)
frml(identity) eqn5 = q - (rhoq*q{1}+eq)
frml(identity) eqn6 = A - (A{1}+ez)
frml(identity) eqn7 = phistar - (rhophistar*phistar{1}+ephistar)
frml(identity) eqn8 = ystar - (rhoystar*ystar{1}+eystar)
frml           eqn9 = er
frml           eqn10 = eq
frml           eqn11 = eystar
frml           eqn12 = ephistar
frml           eqn13 = ez
group dsge eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7 eqn8 eqn9 eqn10 eqn11 eqn12 eqn13
dsge(model=dsge,a=adlm,f=fdlm,z=zdlm) y phi r q exch A phistar ystar er eq eystar ephistar ez
@dlmirf(a=adlm,f=fdlm,page=byshock,$
  shocks=||"R","Q","YSTAR","PHISTAR","Z"||,$
  variables=||"Y","PHI","R","Q","EXCH","A"||)
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: inflation in DSGE

Postby jdacuddy » Tue Feb 02, 2010 8:59 am

Thank you, Tom, for your amazingly quick reply. I will look into it immediately.
Regards
Prof. J.D.A. Cuddy
Graduate Institute of International Studies
132, rue de Lausanne
CH-1211 Geneva
Switzerland
john.cuddy@graduateinstitute.ch
jdacuddy
 
Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

Re: inflation in DSGE

Postby jdacuddy » Tue Feb 02, 2010 1:26 pm

Dear Tom,

Following up on this, having run it, I conclude that the code you posted seems to provide almost exactly the same IRFs as does the Dynare code for the calibrated model; thank you! A natural next step would be to estimate (some of) the parameters, rather than calibrate everything. This is easily done in Dynare; is it possible in RATS? If so, the next step would be to use the estimated DSGE to provide a prior for a BVAR. Again, this is easily done in Dynare; could you explain how (if at all) it can be done in RATS?

Regards
Prof. J.D.A. Cuddy
Graduate Institute of International Studies
132, rue de Lausanne
CH-1211 Geneva
Switzerland
john.cuddy@graduateinstitute.ch
jdacuddy
 
Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

Re: inflation in DSGE

Postby ecrgap » Tue Feb 02, 2010 4:36 pm

Thank you all for your great help
ecrgap
 
Posts: 40
Joined: Mon May 25, 2009 10:24 am

Re: inflation in DSGE

Postby TomDoan » Thu Feb 04, 2010 2:29 pm

jdacuddy wrote:Dear Tom,

Following up on this, having run it, I conclude that the code you posted seems to provide almost exactly the same IRFs as does the Dynare code for the calibrated model; thank you! A natural next step would be to estimate (some of) the parameters, rather than calibrate everything. This is easily done in Dynare; is it possible in RATS? If so, the next step would be to use the estimated DSGE to provide a prior for a BVAR. Again, this is easily done in Dynare; could you explain how (if at all) it can be done in RATS?

Regards


An example of estimation is provided in http://www.estima.com/forum/viewtopic.php?f=26&t=310.

The attached procedure
varfromdlm.src
(2.58 KiB) Downloaded 237 times
converts a selection of variables out of a state space model to their representation as a VAR.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: inflation in DSGE

Postby jdacuddy » Fri Feb 05, 2010 5:37 am

Thank you, Tom. I should have thought of the Ireland example myself!
Regards
Prof. J.D.A. Cuddy
Graduate Institute of International Studies
132, rue de Lausanne
CH-1211 Geneva
Switzerland
john.cuddy@graduateinstitute.ch
jdacuddy
 
Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

Re: inflation in DSGE

Postby ecrgap » Thu Feb 11, 2010 6:00 am

Hi all,

I want to calibrate a DSGE model where the Central Bank uses a threshold interest rate rule (say of TAR form). I guess the model must be simulated in order to generate the IRFs. Is there any sample any model that has done something like that?

Thanks
ecrgap
 
Posts: 40
Joined: Mon May 25, 2009 10:24 am

Re: inflation in DSGE

Postby ivory4 » Thu Dec 02, 2010 8:07 am

Lubik and Shorfheide (2004 AER) Testing for Indeterminacy:An Application to U.S. Monetary Policy

Is there code for this paper? Or some suggestions on this one?
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm


Return to State Space Models/DSGE

Who is online

Users browsing this forum: No registered users and 1 guest