HP Filter simulated variables

I simulate a linearized search model in a business cycle framework, all good here.

I want to check if the model replicates observed business cycle properties. I can easily transform the simulated variables (which are log deviations) into level variables and compare different statistics of the simulated and observed variables.

Here is my question. The stoch_simul command offers a HP-Filter option. I don’t not see why it would be useful to HP-Filter my variables because there is no trend in my model, it is a pure business cycle model. Obviously, the observed variables need to be filtered. Is there any reason to filter my simulated variables?

An HP filter does not only remove a trend, it removes all the frequencies under a threshold level (determined by the value of \lambda. So if you want to compare the simulated and sample data over the same range of frequencies, you need to filter the simulated data.


Thanks for your quick feedback.

Just to make sure I understand things correctly. If I want to compare the observed business cycle statistics of some variables with the statistics generated by a business cycle model, I HP filter the data in order to isolate the cyclical component. I also need to filter the model generated variables to isolate the cyclical component and then compute the statistic of both the cyclical component of observed and cyclical component of the generated variables. Correct?

Yes. Note however that if you consider the first order local approximation of the model, Dynare is able to compute the theoretical hp filtered second order moments (by integrating the spectral density over the selected range of frequencies). You do not need to use simulated data to compute these moments.


I should add that the literature has not reached a consensus here. My and @stepan-a’s preference is to compare filtered empirical data and filtered model data so as to compare the same objects. The idea is to compare model and data on something like an auxiliary model statistic (think indirect inference). But there are also a lot of papers that treat the model as immediately providing data on cyclical properties of the model without any need to filter them. While this is the minority in the literature, you still sometimes encounter such instances.

Thanks for your feedback. I will filter the model data as well.