Applying BP filter in DSGE Model


I am trying to apply a Band pass filter in my RBC DSGE model. I have had a look at the codes and cannot find them anywhere.
If anyone can find or help me with finding or creating the code would be very helpful.
Thank you in advance.


In the current unstable version, there is an option

for this. See

Thank you for your response.

I have found a way to convert the data beforehand and then use that in estimating parameters for the NK model.

Please be aware of the pitfalls of filtering when doing Bayesian estimation. See Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”

Thank you for the prompting me. I have had a look through your guide. I am using Smet wouters 2007 data and the codes are all there for me to use on the NK model estimation. I will be using Bayesian estimation, if you can elaborate more on some of the problems so I can research it.

When doing Bayesian estimation, you should use a first difference filter or linear trend, not a two-sided filter like a bandpass or two-sided HP filter

Thank you for your help. I will include this in my analysis.