stoch_simul series: HP-filtered or not?

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.

stoch_simul series: HP-filtered or not?

Postby olena7 » Wed Nov 17, 2010 10:00 pm

Hi,
I am a little confused about the simulated time series Dynare produces using stoch_simul command (and that are stored in endo_simul array). Are the data there filtered or not?
I am interested in looking at unfiltered data, so I used stock_simul command without HP filter option:
stoch_simul(IRF=0,ORDER=1) y;
I then HP-filtered the resulting time series y and computed its standard deviation, but it seems way smaller than the standard deviation reported in the command window, which leads me to believe that the series was filtered already. In that case, is there a way to obtain unfiltered series?
Thank you!
Olena
olena7
 
Posts: 18
Joined: Wed Mar 25, 2009 8:28 pm

Re: stoch_simul series: HP-filtered or not?

Postby SébastienVillemot » Mon Dec 06, 2010 5:57 pm

Output series are not HP-filtered by default, unless you explicitely use the hp_filter option.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: stoch_simul series: HP-filtered or not?

Postby olena7 » Tue Dec 07, 2010 7:54 pm

Thank you, Sébastien.
I am still a little unclear on comparing Dynare output with the data I am processing.
First of all, when I comment out "periods" command and run

stoch_simul(IRF=0,ORDER=1) y, ys, c, cs, invt, rer, delS;

I get the following:

THEORETICAL MOMENTS

VARIABLE MEAN STD. DEV. VARIANCE
y 0.7949 0.0167 0.0003
ys 0.7949 0.0167 0.0003
c 0.2832 0.0140 0.0002
cs 0.2832 0.0140 0.0002
invt -0.8118 0.0312 0.0010
rer 0.0000 0.0000 0.0000
delS 0.0000 0.0081 0.0001


In order to compute empirical moments of the simulated variables, I do the following
periods = 5500;
...
stoch_simul(IRF=0,hp_filter=1600,ORDER=1) y, ys, c, cs, invt, rer, delS;
I collect the resulting series into a .mat file, and compute standard deviations of each.
I get st.dev(y) = 1.69%, which is very close to the theoretical moment, so far so good.

Finally, I run the following portion of the code:

periods = 5500;
...
stoch_simul(IRF=0,ORDER=1,noprint,nocorr,nofunctions,nomoments) y, rer, delS;
xlswrite('HP Filters.xls', y, 'SimData', 'B2');

which I think should give me unfiltered series for output y, and perform some statistical checks on the resulting output in Excel.
I find that the standard deviation of the raw series [y] (exported from Dynare) is 1.69%, and that the standard deviation of the cycle part of the filtered series [y] is 1%. Here I am using standard built-in Excel command for computing st. dev.
That's why I am confused as to what kind of data (presumably unfiltered, but looks like filtered) Dynare is saving into my Excel sheet.
Perhaps I am missing something very simple here, so I apologize for being slow, but I would really appreciate your help. I am attaching the file for your convenience.
Sincerely,
Olena
Attachments
BCPropAnalysis.m
(1.62 KiB) Downloaded 83 times
Bench.mod
(19.74 KiB) Downloaded 105 times
olena7
 
Posts: 18
Joined: Wed Mar 25, 2009 8:28 pm

Re: stoch_simul series: HP-filtered or not?

Postby SébastienVillemot » Tue Jan 11, 2011 10:26 am

The point is that the vector "y" will always contain unfiltered data, even when you give the "hp_filter" option.

The "hp_filter" option only affects the moments which are displayed.

So 1.69 is the stddev of the unfiltered series, and this is consistent accross your various exercises.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests