The Hodrick-Prescott filter is the probably most popular tool for trend estimation in economics. Compared to other frequently used methods like the Baxter-King filter it allows to estimate the trend for the most recent periods of a time series. However, the Hodrick- Prescott filter suffers from an increasing excess variability at the margins of the series inducing a too flexible trend function at the margins compared to the middle. This paper will tackle this problem using spectral analysis and a flexible penalization. It will show that the excess variability can be reduced immensely by a flexible penalization, while the gain function for the middle of the time series is used as a measure to determine the degree of the flexible penalization.
Hodrick-Prescott filter spectral analysis trend estimation gain function flexible penalization