Packages to implement 1-sided HP filter?


I used a two-sided HP filter when detrending my data initially, rather than a one-sided HP filter. Are there any programs that include one-sided HP filters, or have good 2nd-party programs to do so? I would prefer not to implement one myself, but programs don’t seem to implement this as standard (i.e. Stata only has two-sided filters, for example).

I have access to:
Matlab (basic program, no additional packages)
Python or Julia (if necessary, though I am not at all well-versed in either of these)


Regarding the one-sided HP-filter: it is now contained in the Dynare unstable version. You can also download the Matlab file here:

Thank you!

Hi kgrab,

For Stata implementation please have a look here

Narek Ohanyan