Questions about simulation of business cycle

Hi, everyone, I am a rookie in using Dynare. Now I have a problem about using Dynare to simulate a business cycle process. Actually, I am simulating the results of my pro’s slides about RBC model.

Here are steps of my method. Firstly, I use Dynare to solve the RBC model and get the response to the technology shock. In the first order approximation, y(t)=y(s)+A*[y(t-1)-y(s)]+B*u(t), where y(s) is the steady state value of y. The Dynare manual said that the value information about matrix A and B are store in oo_.dr.ghx and oo_.dr.ghu respectively. Then I take out the matrix in Matlab and do simulation about related business cycle under the technology shock in Dynare.

Although the results of response to technology shock are similar to that of my pro’s slides, the simulated business cycle results are quite different from the slides. Actually the method I used here comes from Prof Erim’s notes, and I follow the instruction in his notes.

Here I upload the codes of Dynare and Matlab, and the documents of my teacher and Prof Erim. I hope someone can kindly tell me where is the problem and how to solve it out. Perhaps, whether there is another method or code to do similar simulation.

Many thanks
RBC.mod (1.39 KB)
pengfeinew.m (1.98 KB)
pengfei model.pdf (151 KB)
Prof Eric’s instruction.pdf (228 KB)

Look at the more recent slides. You are missing the HP-filtering

Thank you for the reply, Jpfeifer. You mean that I miss the part of HP-filtering in the Dynare code when I carry out the simulation?

Yes, try using the

option of stoch_simul