## inflation in DSGE

Discussion of State Space and Dynamic Stochastic General Equilibrium Models

### inflation in DSGE

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

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 ydec series rstar wstar ystardec series x u z*dec real beta sigma chi alpha thetaW thetaP xiW xiPdec real ubar zbar xbar kbardec real rhoxdec real lbar ybar cbardec real kappaP kappaW** Household parameters*compute beta      = .99compute sigma     = 1.5compute chi       = 1.5compute ubar      = 0.3163compute zbar      = 0.03** Production function parameters*compute alpha     = .3compute rhox       = 0.95compute xbar      = 4.0266compute kbar      = 30.0*ubar** Calvo process parameters*compute thetaW    = 1.0/3.0compute thetaP    = 1.0/3.0compute xiW       = .75compute xiP       = .75compute eps       = 6.0compute phi       = 6.0** Policy parameters*compute rhor       = 0.9compute gammapi    = 2.0compute gammaogap = 0.125*compute lbar      = .27compute ybar      = 10.0*ubarcompute 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 * lcbarcompute kappaP    = (1-xiP*beta)*(1-xiP)/xiPcompute 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 c1dsge(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: 2725
Joined: Wed Nov 01, 2006 5:36 pm

### Re: inflation in DSGE

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

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
132, rue de Lausanne
CH-1211 Geneva
Switzerland
jdacuddy

Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

### Re: inflation in DSGE

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 ystardec series er eq eystar ephistar ezdec real beta tau k alpha rhor rhoq rhoystar rhophistar rhoz gamma1 gamma2 gamma3*compute beta=0.96compute tau=0.5compute k=0.5compute alpha=0.10compute rhor=0.5compute rhoq=0.4compute rhoystar=0.9compute rhophistar=0.8compute rhoz=0.2compute gamma1=1.5compute gamma2=0.25compute gamma3=0.25frml(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 = erfrml           eqn10 = eqfrml           eqn11 = eystarfrml           eqn12 = ephistarfrml           eqn13 = ezgroup dsge eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7 eqn8 eqn9 eqn10 eqn11 eqn12 eqn13dsge(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: 2725
Joined: Wed Nov 01, 2006 5:36 pm

### Re: inflation in DSGE

Thank you, Tom, for your amazingly quick reply. I will look into it immediately.
Regards
Prof. J.D.A. Cuddy
132, rue de Lausanne
CH-1211 Geneva
Switzerland
jdacuddy

Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

### Re: inflation in DSGE

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
132, rue de Lausanne
CH-1211 Geneva
Switzerland
jdacuddy

Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

### Re: inflation in DSGE

Thank you all for your great help
ecrgap

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

### Re: inflation in DSGE

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
converts a selection of variables out of a state space model to their representation as a VAR.
TomDoan

Posts: 2725
Joined: Wed Nov 01, 2006 5:36 pm

### Re: inflation in DSGE

Thank you, Tom. I should have thought of the Ireland example myself!
Regards
Prof. J.D.A. Cuddy
132, rue de Lausanne
CH-1211 Geneva
Switzerland
jdacuddy

Posts: 11
Joined: Thu Nov 09, 2006 2:38 am
Location: Geneva Switzerland

### Re: inflation in DSGE

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

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