# The Schorfheide (2000) example

**URL:** <https://forum.dynare.org/t/the-schorfheide-2000-example/5008>\
**Category:** Dynare help (legacy posts)\
**Created:** [22 September 2015 05:18 UTC](https://forum.dynare.org/t/the-schorfheide-2000-example/5008 "2015-09-22T05:18:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![snickles](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@snickles](https://forum.dynare.org/u/snickles)\
**Post date:** [22 September 2015 05:18 UTC](https://forum.dynare.org/t/the-schorfheide-2000-example/5008/1 "2015-09-22T05:18:28Z")

</div>

Good day all,

I have been running the Dynare example code (both fs2000\_nonstationary.mod and fs2000.mod) that come as part of the pre-programmed Dynare example suite (fs2000\_nonstationary.mod code presented below). The model is based on the Nason and Cogley (1994) model and the Schorfheide (2000) paper. It is essentially the same as the example given in Prof Eric Sims’ course notes online (Spring 2010) “Money in a Real Business Cycle Model” ( [www3.nd.edu/~esims1/money\_rbc.pdf](http://www3.nd.edu/~esims1/money_rbc.pdf) ). What I cannot understand is why the Response to a technology shock in the Dynare examples produce IRFs with negative real output responses to the TFP shock – perhaps I am missing something regarding how to interpret the output but I have searched high and low for how it should be interpreted and can find nothing. My best guess is that is has something to do with the options connected to the stoch\_simul options and that the IRFs need to take on a certain form which is not the default (but I certainly have no confidence in my own guess here).

The output shown in the Nason and Cogley paper, the Schorfheide paper and Sims’ notes all show what you would expect, a positive real output response. I have attached the Nason and Cogley original the discussion is from the bottom of page S49 with the diagrams on page S50, the discussion is also in Schorfheide (attached) at the bottom of page pg 663 onto pg 664 with the diagram on pg 664. Is someone able to advise how the example code can be specified to generate the results as they are displayed in the reference material?

This is the fs2000\_nonstationary.mod code:

/\*

- This file is a modified version of ‘fs2000.mod’.
- 
- The difference is that, here, the equations are written in non-stationary form,
- and Dynare automatically does the detrending.
- 
- Also note that “m” and “dA” in ‘fs2000.mod’ are here called “gM” and “gA”  
\*/

/\*

- Copyright © 2004-2010 Dynare Team
- 
- This file is part of Dynare.
- 
- Dynare is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- 
- Dynare is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- 
- You should have received a copy of the GNU General Public License
- along with Dynare. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).  
\*/

var gM gA;  
trend\_var(growth\_factor=gA) A;  
trend\_var(growth\_factor=gM) M;  
var(deflator=A) k c y;  
var(deflator=M(-1)/A) P;  
var(deflator=M(-1)) W l d;  
var R n;  
varexo e\_a e\_m;

parameters alp bet gam mst rho psi del;

alp = 0.33;  
bet = 0.99;  
gam = 0.003;  
mst = 1.011;  
rho = 0.7;  
psi = 0.787;  
del = 0.02;

model;  
gA = exp(gam+e\_a);  
log(gM) = (1-rho)_log(mst) + rho_log(gM(-1))+e\_m;  
c+k = k(-1)^alp\*(A_n)^(1-alp)+(1-del)k(-1);  
Pc = M;  
P/(c(+1)P(+1))=betP(+1)_(alp_k^(alp-1)_(A(+1)_n(+1))^(1-alp)+(1-del))/(c(+2)P(+2));  
(psi/(1-psi))(c_P/(1-n))=W;  
R = P\*(1-alp)_k(-1)^alp_A^(1-alp)_n^(-alp)/W;  
W = l/n;  
M-M(-1)+d = l;  
1/(c_P)=bet_R/(c(+1)P(+1));  
y = k(-1)^alp(A_n)^(1-alp);  
end;

initval;  
k = 6;  
gM = mst;  
P = 2.25;  
c = 0.45;  
W = 4;  
R = 1.02;  
d = 0.85;  
n = 0.19;  
l = 0.86;  
y = 0.6;  
gA = exp(gam);  
end;

shocks;  
var e\_a; stderr 0.014;  
var e\_m; stderr 0.005;  
end;

steady;

check;

stoch\_simul;

Thanks in advance  
Have a great day  
[2000 - Schorfheide - Loss function-based evaluation of DSGE models.pdf](https://forum.dynare.org/uploads/default/original/2X/b/b417ddcee33a22bd246058a0e46f248d23d595b2.pdf) (254 KB)  
[1994 - Nason, Cogley - Testing the implications of long-run neutrality for monetary business cycle models.pdf](https://forum.dynare.org/uploads/default/original/2X/8/87822b0f029c2fc5dd43efc93f0e1ddb3fb0cdb4.pdf) (1.86 MB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [22 September 2015 08:42 UTC](https://forum.dynare.org/t/the-schorfheide-2000-example/5008/2 "2015-09-22T08:42:47Z")

</div>

Could the reason be that Schorheide has a permanent technology shock and you are considering a detrended model, i.e. you have to add the new higher steady state back to it?

---

<div class="post-metadata">

**Author:** ![snickles](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@snickles](https://forum.dynare.org/u/snickles)\
**Post date:** [22 September 2015 10:39 UTC](https://forum.dynare.org/t/the-schorfheide-2000-example/5008/3 "2015-09-22T10:39:54Z")

</div>

Hi Prof,  
I agree that could very well be a reason! However, my ignorance is on display here in that I would therefore assume it would be straight forward using Dynare to add the higher steady state and produce a graph like the ones in Schorfheide etc. But I have no idea how that would be done and I have not come a cross such a transformation in all the example codes I have - I would assume people would be doing this but I have not seen such a thing. Is anyone able to suggest to me how the code should be altered to produce the graphs Schorfheide etc produce. I.e. How would I plot the trended IRF result of a permanent technology shock? Is there a resource someone could direct me to that discusses such a procedure?  
Thanking you all

---

<div class="post-metadata">

**Author:** ![snickles](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@snickles](https://forum.dynare.org/u/snickles)\
**Post date:** [22 September 2015 12:29 UTC](https://forum.dynare.org/t/the-schorfheide-2000-example/5008/4 "2015-09-22T12:29:28Z")

</div>

Hi Prof,

I see you may have an potential code example on your webpage, from: AguiarGopinath2007.mod :

//%%%%%%%%%%%%%%%%%%%%%% Plot impulse response functions of %%%%%%%%%%%%%%  
//%%%%%%%%%%%%%%%%%%%%%% non-stationary time series %%%%%%%%%%%%%%

//generate IRF of stationary model variables  
stoch\_simul(order=1,nograph) log\_y log\_c log\_i g;

//Now back out IRF of non-stationary model variables by adding trend growth back

log\_Gamma\_0=0; //Initialize Level of Technology at t=0;  
log\_Gamma(1,1)=g\_eps\_g(1,1)+log\_Gamma\_0; //Level of Tech. after shock in period 1

// reaccumulate the non-stationary level series; note that AG2007 detrend with X\_t-1, thus the technology level in the loop is shifted by 1 period  
for ii=2:options\_.irf  
log\_Gamma(ii,1)=g\_eps\_g(ii,1)+log\_Gamma(ii-1,1);  
log\_y\_nonstationary(ii,1)=log\_y\_eps\_g(ii,1)+log\_Gamma(ii-1,1);  
log\_c\_nonstationary(ii,1)=log\_c\_eps\_g(ii,1)+log\_Gamma(ii-1,1);  
log\_i\_nonstationary(ii,1)=log\_i\_eps\_g(ii,1)+log\_Gamma(ii-1,1);  
end  
//Make the plot  
figure(‘Name’,‘IRF of non-detrended variables to a trend productivity shock’);  
subplot(3,1,1)  
plot(1:options\_.irf,log\_y\_nonstationary)  
title(‘Output’)  
subplot(3,1,2)  
plot(1:options\_.irf,log\_c\_nonstationary)  
title(‘Consumption’)  
subplot(3,1,3)  
plot(1:options\_.irf,log\_i\_nonstationary)  
title(‘Investment’)

I am going to attempt to to play around with this before probably getting it wrong and crawling back here for assistance …

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [22 September 2015 14:55 UTC](https://forum.dynare.org/t/the-schorfheide-2000-example/5008/5 "2015-09-22T14:55:23Z")

</div>

Yes, that is the way to go.
