one-sided-HP-filter in stoch_simul - how to do that?

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

one-sided-HP-filter in stoch_simul - how to do that?

Postby AGM » Thu Aug 02, 2012 2:08 pm

Hi,

how can I change the dynare code to apply the one-sided HP filter in the stoch_simul command?

I have a file defining the function one-sided-HP-filter. Among the dynare files, I found a file called sample_hp_filter, so I thought that it is enough if I rename my file and function and remove the original Dynare file. But it did not work.

Where can I found the code that can be changed in a way that a one-sided HP filter is computed?

I would be very thankful for your help.
Alma

Ps By the way, does it make a huge difference for the simulated data if we apply the one-sided or double-sided filter? In the end, we always come back to the ss, so perhaps this difference is not so important.
AGM
 
Posts: 3
Joined: Tue Jun 12, 2012 10:12 pm

Re: one-sided-HP-filter in stoch_simul - how to do that?

Postby kyri82 » Tue Aug 07, 2012 9:12 am

I am not sure how you can ask dynare to do that automatically, but you can do it manually. Each time dynare simulates the model, it saves all the simulated variables in a matrix called: oo_.endo_simul. This matrix is of size J-by-N, where J is the number of variables and N is the number of periods you asked to simulate (maybe the raws and columns are inversed, dont remember now but you can easily verify). Check the manual.

Then, what you can do is to save all your variables in a matrix, e.g:
A = oo_.endo_simul ;

and then you can apply whichever filter you want and derive whatever statistics you want. In that case make sure that you do not take into account some of the initial observations of the simulation, in computing statistics dynare drops by default 100, but you can drop as many as you wish with the option drop (again, see the Manual).

Hope that helps.

K.
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: one-sided-HP-filter in stoch_simul - how to do that?

Postby AGM » Thu Aug 09, 2012 12:38 pm

Hi,

thank you very much for your help!

You saved my life:)
AGM
 
Posts: 3
Joined: Tue Jun 12, 2012 10:12 pm

Re: one-sided-HP-filter in stoch_simul - how to do that?

Postby kyri82 » Thu Aug 09, 2012 2:47 pm

No problem! :)
Good luck!
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 4 guests