EconBase
← Back to paper

Boosting: Why You Can Use the HP Filter

Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.

115,763 characters · 14 sections · 100 citation commands

Rendered from LaTeX for readability, not typeset faithfully. Citation keys are highlighted; maths is left as source; figures, tables and equation environments are summarised rather than reproduced; unrecognised commands are greyed out so nothing is silently dropped. Email addresses are removed.

Boosting: Why You Can Use the HP Filter

\thispagestyle{empty}

JEL codes: C22, C55, E20

Key words: Boosting, Cycles, Empirical macroeconomics, Hodrick-Prescott filter, Machine learning, Nonstationary time series, Trends, Unit root processes

{ Abstract: We propose a procedure of iterating the HP filter to produce a smarter smoothing device, called the boosted HP (bHP) filter, based on $L_{2}$-boosting in machine learning. Limit theory shows that the bHP filter asymptotically recovers trend mechanisms that involve integrated processes, deterministic drifts, and structural breaks, covering the most common trends that appear in current modeling methodology. A stopping criterion automates the algorithm, giving a data-determined method for data-rich environments. The methodology is illustrated in simulations and with three real data examples that highlight the differences between simple HP filtering, the bHP filter, and an alternative autoregressive approach. }

\singlespacing \setcounter{page}{1}

quoteThe principle adopted here in the construction of a trend for a time series consists in minimizing a linear combination of two sums of squares, of which one refers to the second differences of the trend values, the other to the deviations of the observations from the trend values ... this procedure seems a particularly natural one when dealing with economic time series. The resulting family of trends may be described as quasi-linear trends. leser1961simple
quoteOur statistical approach does not utilize standard time series analysis. The maintained hypothesis based on growth theory considerations is that the growth component of aggregate economic times series varies smoothly over time. hodrick1997postwar

Introduction

Two prominent features of macroeconomic data are trending long-run growth in aggregate economic activity and a cyclical component that represents fluctuations in this activity over shorter periods known as business cycles. Modern macroeconomic theory of the business cycle, evident in the vast literature on RBC and DSGE modeling, seeks to explain the cyclical movement and co-movement of macroeconomic variables about long-run trends. Both aspects of economic activity are important in economic analysis and policy making. Trends are an intrinsic element in determining long term economic prospects and the overall health of an economy. Cyclical behavior is especially important to policy makers, who are interested in understanding past contractions with a view to foreseeing the onset of future recessions and minimizing their impact on employment and business activity.

To analyze business cycles in observed data it is necessary to isolate the cyclical component from the trend. Rigorous study requires clarity concerning the trend mechanism and various definitions have been used in past work to distinguish slow moving and cyclical mechanisms in the data.\footnote{Readers are referred to phillips1998new,phillips2003laws,phillips2005automated,phillips2010mysteries, phillips2004local, white2011consideration, and muller2018long for general discussion and limitations of trend formulations commonly used in empirical work.} Decomposition into trend and cycle is commonly achieved by regression or filtering. The latter is primarily motivated by the prior view that a trend is distinguished as a smoothly varying component in relation to the observed data, a concept reflected in the header quotation from hodrick1997postwar (hereafter HP), leading to the so-called HP filter, to the use of spectral methods hannan1963, christiano2003band, and to the use of orthonormal polynomial regression phillips1998new,phillips2005automated, phillips2014optimal. The HP filter belongs to the statistical approach that was introduced by \citet*{whittaker1922new} and \citet*{whittaker1960calculus}, who provided a probabilistic framework of penalized maximum likelihood estimation to deliver a quantitative measure of trend (or graduation in their terminology). The explicit form of the smoothness measure penalty involving squared second differences in HP (1997) was used in earlier work by leser1961simple, who emphasized its relevance to trend determination with economic data on the grounds of its `quasi-linear' trend-producing properties, as indicated in the primary header quotation.

The HP method is now widely used in applied macroeconomic work by economists in central banks, international economic agencies, industry, and government. Its use in academic work is less extensive, partly because it has been subject over many years to considerable criticism and analyses that have revealed a myriad of its limitations for empirical studies in economics, an early example being cogley1995effects. For recent discussion of the merits and demerits of the filter, see phillips2015business (PJ, henceforth) and hamilton2017you and the many references cited therein.

Given time series data $\left(x_{t}:t=1,\ldots,n\right)$, the HP method decomposes the series into two additive components --- a trend component $\left(f_{t}\right)$, and a residual or cyclical component $\left(c_{t}\right)$, estimated as

equation[equation omitted — 322 chars of source]

where $\Delta f_{t}=f_{t}-f_{t-1}$, $\Delta^2 f_{t}= \Delta f_{t}- \Delta f_{t-1} = f_{t}- 2 f_{t-1} + f_{t-2} $, and $\lambda\geq0$ is a tuning parameter that controls the extent of the penalty. As is apparent from this criterion, the method is nonparametric and the choice of $\lambda$ inevitably plays a major role in determining the shapes of the fitted trend and cycle functions. If $\lambda$ is selected too large, the fitted trend becomes nearly linear, as implied by Leser's (1961) characterization, and a linear trend is indeed the solution when $\lambda \to \infty$. In consequence, if the trend is nonlinear and $\lambda$ is too large, the HP fitted trend leaves a residual trend that inevitably contaminates the cyclical component. If $\lambda$ is selected too small, the fitted trend becomes highly flexible, so that it closely tracks the data and thereby embodies elements of short-term fluctuations. In the absence of an underlying model that defines and enables direct quantification of trend and cycle, some degree of cycle distortion with the HP filter is inevitable. Of course, precisely the same criticism applies to other smoothing techniques, as well as regression methods of trend extraction when the trend model is misspecified, as is nearly always the case in practical work.

In the application of modern nonparametric methods, serious efforts are normally made to choose tuning parameters based on some well-defined optimization criterion with data-determined versions of these criteria that can be implemented in empirical work. This approach is greatly facilitated by the use of an underlying model representing the generating mechanism. By contrast, empirical practice with the HP filter almost universally relies on standard settings for the tuning parameter that have been suggested largely by experimentation with macroeconomic data and heuristic reasoning about the form of economic cycles and trends. For quarterly data the standard choice is $\lambda=1600$, as recommended by HP (1997) based on their experimentation with US data. This value has served as a gold standard in converting the tuning parameter to other sampling frequencies such as annual or monthly data ravn2002adjusting. Importantly, these HP filter smoothing parameter settings are normally employed irrespective of the sample size of the data in contrast to standard nonparametric methods.

HP filtering retains an agnostic position with regard to the exact functional form of the trend and cycle. This approach has the advantage of generality, but the central weakness is that its properties with respect to consistent trend estimation are poorly understood, especially with regard to the relevant choice of the tuning parameter. Recent research by PJ has shown that the performance of the filter as a potentially consistent estimator of trends of certain types can be assessed directly in relation to the choice of the tuning parameter, just as in standard nonparametric analysis as the sample size $n \to \infty$. That work revealed the constraints that are needed on $\lambda$ in order to achieve consistent trend estimation for polynomial trends and stochastic process trends. The paper also analyzed the effect of the filter on trends with structural breaks. In doing so, PJ showed how the standard HP filter settings may not be adequate in removing trends --- particularly stochastic trends --- in economic data, a conclusion that reverses earlier thinking king1993low to the effect that the HP filter removes up to four unit roots in the original data. PJ further showed that the common choice of the tuning parameter $\lambda=1600$ for quarterly data is typically too large to completely remove stochastic process trends given the length of the macroeconomic time series usually encountered in practice. It is likely therefore that remnants of stochastic trends linger in the fitted cycles of much applied research, a conclusion supported by the recent examples exhibited in hamilton2017you and the earlier work by cogley1995effects.

The present paper proposes an easy-to-implement modification that is designed to make the HP filter more effective in trend fitting and trend elimination, and is formulated with data-determined smoothing choices to aid practical application. The idea is simple. Since the cyclical component may often retain trend elements, we feed the data into the filter again to clean the leftover elements. The notion of refitting the residual in statistical applications goes back to tukey1977exploratory under the name twicing, where procedures were employed twice to assist in data-cleaning exercises. The notion of twicing can be continued into “$n$--ing”, as discussed in buja1989linear. This approach motivates the present proposal of repeated application of the HP filter. Since the solution of the HP filter can be explicitly expressed as a linear operation, which will be made clear in Section (ref), repeated HP fitting is closely related to the $L_{2}$-boosting buhlmann2003boosting procedure which is now commonly used in machine learning.

The existing statistical theory on boosting is developed mostly for environments with independent identically distributed (iid) data. We are unaware of any earlier work concerned with the use of $L_{2}$-boosting on stochastically trending data or nonstationary time series. A primary contribution of the present paper is to apply and analyze the idea of repeated fitting algorithms in machine learning to trend detection and nonstationary time series environments. In particular, we establish asymptotic theory to justify the use of the boosted version of the HP filter, extending earlier work by PJ on the asymptotics of the HP filter. We find that if the number of iterations slowly diverges with the sample size, the boosted HP filter (bHP filter, hereafter) can recover the underlying trend irrespective of whether the time series contains a stochastic process trend, a deterministic polynomial drift, or a polynomial drift with a structural break. An interesting implication of the asymptotic theory in the latter case is that the bHP filter effectively delivers a consistent estimator of the break point. This result extends to the case of multiple structural breaks, so the boosted filter provides a new device for consistently estimating multiple break points, delivered automatically without additional methods of detection.

Use of machine learning methods in econometrics has grown quickly in recent years with a particular focus on applied microeconomics where large cross sectional and wide panel datasets are available. The low-frequency nature of most macroeconomic time series, on the other hand, means that the volume of today's macroeconomic databases is much smaller by comparison and is, of course, completely dwarfed by those generated from Internet communication.\footnote{ For instance, the size of the latest version of FRED-MD (as of August 2020) is 600kb for monthly data or 170kb for quarterly data. FRED-MD is the Monthly Databases for Macroeconomic Research (\url{https://research.stlouisfed.org/econ/mccracken/fred-databases/}). See mccracken2016fred for details.} Nonetheless, the phenomena that macroeconomists study are no less complex than those that confront scientists working with `big data' and the scope for machine learning methods is large. For example, in empirical analysis using country-level macro indicators, macroeconomists handle data collected from a large number of heterogeneous economies in highly varying stages of economic development. In such cases, where there are many possible determining factors and diverse time series trajectories, automated econometric procedures phillips2005automated can be of tremendous appeal in practical work, as has been argued recently by many authors since the development of high dimensional regression methods such as Lasso tibshirani1996regression.

This line of thinking partly motivates the present econometric implementation of machine learning methods in which we propose two data-driven stopping rules to terminate iterations of the bHP filter. One rule ceases the iteration according to the outcome of a unit root test, and is appropriate when stationary time series is considered a prerequisite for further investigation, such as business cycle analysis. The second rule relies on a new version of the Bayesian information criterion (BIC) that is developed for the present bHP filter framework to take into account sample fit and effective degrees of freedom after each iteration. The latter approach accords with the now common practice of using BIC-type information criteria as stopping rules in econometric work.

An important additional advantage to boosting is that it provides robustness to the original setting of the tuning parameter $\lambda$ in the HP filter prior to the boosting iteration. In particular, simulation experiments (reported in Appendix (ref)) show that the boosted filter is robust to the HP tuning parameter setting over a wide region amounting to a factor of $4$ on either side of the conventional $\lambda=1600$ used in empirical work with quarterly data. This means that practitioners using the boosted HP filter can employ HP algorithms with standard parameter settings in conjunction with the boosting iteration and its automated termination criteria with some confidence concerning the robustness of the results. In effect, this all but eliminates dependence of the bHP on the original HP tuning parameter and provides empirical investigators some protection against critiques that findings are dependent on an arbitrary choice of tuning parameter. This advantage is particularly useful in cross country panel comparisons of cycles and trends where multiple time series of different lengths are commonly studied in applications.

We conduct three real data applications of the HP and bHP filters to study the impact of our iterative fitting algorithm. The first application revisits Okun's law, which posits an empirical association of comovement between real GDP and unemployment, in an international cross country setting. ball2017okun extend the scope of okun1962potential's original focus on the United States to 20 OECD countries, applying the standard HP filter to each time series to obtain deviations from long run levels. Accordingly, when the standard filter fails to remove the time trend, the resulting Okun law regression can suffer spurious regression effects. The bHP filter helps to mitigate the effects of potential contamination from long run influences.

A second example conducts a cross country comparison of business cycles. In an extensive application of HP methods to remove trend, aguiar2007emerging suggest that cyclical components are more persistent and volatile in emerging economies than in developed countries. In revisiting this application using the bHP filter, we find that the time series collected from the emerging economies are much shorter than those from the developed ones, and so the use of the standard $\lambda=1600$ tuning parameter uniformly across all countries tends to over-penalize the shorter series. Repeated fitting helps to regularize the unbalanced panel and robustify the finding by aguiar2007emerging of the empirical distinction in cyclical behavior between emerging and developed economies.

The third application examines US industrial production over the last century from 1919 to 2018. Like many other macroeconomic time series this series displays strong trend characteristics with some major fluctuations over subperiods that include two world wars and the great depression during the early part of the period, and the financial crisis and great recession over the latter period. As such, the series presents challenges in trend determination that include the complex issue of whether such subperiods are better interpreted as part of the trend or part of the evolving cyclical processes of modern industrialized economies. In this application, we provide a detailed comparison of the HP and bHP filters with the alternative autoregressive modeling approach recently advocated by hamilton2017you.

We close this introduction with a brief discussion of related literature on filtering and boosting. First, there are now many competing methods of data filtering to remove trend such as the band pass filter methods of baxter1999measuring, christiano2003band, and corbae2006extracting. Most of these share many common characteristics with the HP filter. Nonetheless, the HP filter remains the most popular\footnote{As of August, 2020, the article by hodrick1997postwar had over 9,500 listed citations and the article by baxter1999measuring nearly 4,000 citations in Google Scholar.} in practical work and serves as a benchmark for other agnostic methods of trend extraction. In addition, there has been renewed recent interest in the theoretical properties of the HP filter, useful algebraic representations, and computational algorithms. phillips2010two and PJ provide exact matrix and operator representations and new asymptotics. cornea2017explicit gives an explicit algebraic formula for the HP filter in finite samples. de2016econometrics and sakarya2017property provide further finite sample results, including another representation of the HP filter as a symmetric weighted average plus some adjustments. hamilton2017you provides a cautionary note concerning the limitations of the HP filter approach, reinforcing earlier warnings and suggesting the alternative of scalar autoregression.

Second, machine learning methods have been employed to generate new statistical procedures specifically tailored for economic applications in recent work by belloni2012sparse, belloni2014inference, chernozhukov2015post, fan2015power, hirano2017forecasting and caner2018asymptotically, to name a few. Boosting is one of the most successful machine learning methods. Originally proposed for classification problems freund1995desicion, boosting has given rise to many useful variants (e.g. hastie2009bible). buhlmann2003boosting extended the idea of refitting to linear regression with the $L_{2}$ norm for the residuals, opening up a wide range of potential applications. In high dimensional regression, component-wise boosting is also related to forward stage selection and the greedy algorithm buehlmann2006boosting. The idea of refitting (specifically twicing) was introduced by tukey1977exploratory and appeared in econometrics in newey2004twicing and most recently lee2018lasso. In high-dimensional regression, bai2009boosting employed boosting in macroeconomic forecasting. shi2016econometric used boosting to select relevant moments in structural models defined by many moment conditions. ng2014viewpoint and luo2017_2 applied boosting to recession forecasting and other economic examples.

The rest of the paper is organized as follows. Section (ref) introduces the iterative algorithm for boosting the HP filter and develops asymptotic theory that characterizes the behavior of the boosted filter, giving conditions for consistent estimation of stochastic process and deterministic polynomial trends with possible structural breaks. Stopping rules are provided to automate the procedure for practical work. Simulations are conducted in Section (ref) to reveal the effect of boosting along with the stopping rules. Section (ref) reports three empirical applications of the bHP methodology. Section (ref) concludes with a summary of arguments in support of the bHP filter as a trend determination device in empirical research and a response based on our present findings to the recent critique of the HP filter by hamilton2017you. Proofs are given in Appendix A and additional graphical demonstrations in Appendix B.

The Boosted HP Filter

The Boosting Algorithm

The optimization problem ((ref)) leading to the HP filter and related criteria for general filters of this type have closed-form algebraic solutions in convenient matrix form.\footnote{See phillips2010two, PJ, de2016econometrics, and cornea2017explicit for recent work on exact matrix forms and other exact representations of the HP and related filters.} In the HP case, if $D'$ is the rectangular $\left(n-2\right)\times n$ matrix with second differencing vector $d=(1,-2,1)^{\prime}$ along the leading tri-diagonals and $I_{n}$ is the $n\times n$ identity matrix, the explicit form of the trend solution is

equation[equation omitted — 57 chars of source]

where $S=\left(I_n+\lambda DD'\right)^{-1}$ is a deterministic operator and $x=(x_1,...,x_n)'$ is the sample data. The smoothed component $\widehat{f}^{\mathrm{HP}}$ is interpreted as the estimated trend and

equation[equation omitted — 103 chars of source]

as the estimated cyclical or stationary component.

The behavior and asymptotic properties of the estimated trend $\widehat{f}^{\mathrm{HP}}$ crucially depend on the choice of the tuning parameter and the underlying generating mechanism of $x_t$. For macroeconomic data the mechanism may reasonably be expected to involve a stochastic trend, possibly accompanied by some deterministic drift component that may be well modeled by a low order polynomial or a similar deterministic function subject to breaks. In the prototypical case of a unit root process, $x_t$ satisfies under quite general conditions the functional law phillips1992asymptotics

equation[equation omitted — 94 chars of source]

where $\lfloor \cdot \rfloor $ is the floor function, $B$ is Brownian motion with variance $\omega^2$ given by the long run variance of $\Delta x_t$, and $\rightsquigarrow$ signifies weak convergence, here on the Skorohod space $D[0,1]$. Asymptotics analogous to (ref) with related Gaussian limit processes such as linear diffusions hold for other stochastic trends after appropriate normalization and the methods we discuss are applicable in such cases.

The problem of consistent HP filter estimation of the trend then amounts to whether as $n \to \infty$ we have $ n^{-1/2} {\widehat{f}_{\left\lfloor nr\right\rfloor }^{\mathrm{HP}}} \rightsquigarrow B(r)$, in which case the filter asymptotically captures the underlying stochastic process trend in $x_t$. PJ show that this reproduction of the asymptotic form of the trend holds only under special restrictions on the smoothing parameter $\lambda$ that ensure it does not diverge too quickly. In particular, if $\lambda = O(n^4)$ or greater as $n \to \infty$, then the HP filter trend $ \widehat{f}_{\left\lfloor nr\right\rfloor }^{\mathrm{HP}}$ is inconsistent. In such cases, $ n^{-1/2} {\widehat{f}_{\left\lfloor nr\right\rfloor }^{\mathrm{HP}}} \rightsquigarrow f^{\mathrm{HP}}\left(r\right)$ where $f^{\mathrm{HP}}\left(r\right)$ is a smooth stochastic process different from $B(r)$, which implies that the cyclical component $\widehat{c}^{\mathrm{HP}}=x-\widehat{f}^{\mathrm{HP}}$ inevitably inherits elements of the stochastic trend even in the limit. Similar issues arise in the case of time series with stochastic trends coupled with deterministic drift or deterministic drift with breaks (see PJ for details). In all these cases, the HP filter fails to recover the underlying trend in $x_t$ asymptotically. The limit theory therefore confirms much informal commentary in the literature concerning the shortcomings of the HP filter as a suitable trend determination mechanism for economic data.

We propose an easy remedy to establish consistent estimation of stochastic process and deterministic trends in the data. If the cyclical component $\widehat{c}_{t}^{\mathrm{HP}}$ still exhibits trending behavior after HP filtering, we continue to apply the HP filter to $\widehat{c}^{\mathrm{HP}}$ to remove the leftover trend residual. After a second fitting, the cyclical component can be written as \[ \widehat{c}^{\left(2\right)}=\left(I_{n}-S\right)\widehat{c}^{\mathrm{HP}}=\left(I_{n}-S\right)^{2}x, \] where the superscript “$\left(2\right)$” indicates that the HP filter is fitted twice. The corresponding trend component becomes \[ \widehat{f}^{\left(2\right)}=x-\widehat{c}^{\left(2\right)}=\left(I_{n}-\left(I_{n}-S\right)^{2}\right)x. \] If $\widehat{c}^{\left(2\right)}$ continues to exhibit trend behavior, the filtering process may be continued for a third or further time. After $m$ repeated applications of the filter, the cyclical and trend component are

eqnarray[eqnarray omitted — 229 chars of source]

where $B_{m}=I_{n}-\left(I_{n}-S\right)^{m}.$ We call this iterated process the boosted HP filter or bHP in view of its similarity to $L_{2}$-boosting in terms of numerical implementation.

Boosting is so-called because it has the capacity to enhance the flexibility of what is called in the machine learning literature a weak base learner as the starting point. In machine learning language, this process is known as a mechanism for achieving the `strength of weak learnability' schapire1990strength. The intuition behind the asymptotic validity of the bHP filter is the observation that the HP filter, with a conventional choice of the tuning parameter $\lambda$, serves as a weak base learner.\footnote{In quarterly economic time series for example, accumulating evidence has shown that the setting $\lambda = 1600$ is often too large given the length of the time series typically encountered in empirical macroeconomics schlicht2005estimating,phillips2015business, hamilton2017you.} In consequence, the crude HP filter is too weak by itself to fully capture the underlying trend, particularly when the trend involves a stochastic process. Initiating from the conventional HP filter, we iterate the procedure to strengthen this filter as a weak base learner. As discussed in the following section, under certain conditions on the number of iterations $m$ the boosted version is able to recover the trend as $n\to \infty$, even if the base learner itself is too weak for consistent estimation.

Asymptotic Theory

The criterion underlying the HP filter is agnostic about the data generation process. The key element in controlling the capacity of the filter to capture underlying trend behavior of various forms lies in the choice of the smoothing parameter $\lambda$ and controls that are implemented on its asymptotic behavior in relation to sample size. The latter is particularly important and is presently almost universally neglected in empirical work. As we now discuss, suitable controls may be implemented on the boosted HP filter to ensure that underlying trend behavior is captured consistently.

It will be convenient to start with the case where the time series $x_t$ has a stochastic trend and satifies the functional law ((ref)). In this case, Theorem 3 of PJ shows that if $\lambda=\mu n^{4}$ for some fixed constant $\mu>0$ independent of the sample size $n$, then the limiting form of the HP filter is given by a smooth random function whose series representation is

align[align omitted — 260 chars of source]

where $\xi_{k}\sim\mathrm{iid\ }N\left(0,\omega^{2}\right)$, $\varphi_{k}\left(r\right)=\sqrt{2}\sin\left(r/\sqrt{\lambda_{k}}\right)$ and $\lambda_{k}=\left[\left(k- 0.5 \right)\pi\right]^{-2}$. This asymptotic form of the HP filtered data is deduced by analyzing the asymptotic impact of the HP operator on the Karhunen-Lo\`{e}ve (KL) representation\footnote{Readers may refer to \citet*{phillips1998new} for further details of KL representations and their relevance in the asymptotic analysis of nonstationary time series.} of the Brownian motion limit function given in ((ref)), viz,

align[align omitted — 98 chars of source]

The representations ((ref)) and ((ref)) are orthonormal series in the trigonometric polynomials $\varphi_{k}\left(r\right)$ as well as the random coefficients $\xi_k$ and the series converge almost surely and uniformly for $r \in [0,1]$. But whereas Brownian motion is everywhere non-differentiable, the asymptotic form of the HP filter given in ((ref)) is differentiable to the fourth order and converges almost surely and uniformly for $r \in [0,1]$. As discussed in PJ, for typical time series of quarterly macroeconomic data, the limit form in ((ref)) produces a smoothed version of the time series that closely matches output from an HP filter with $\lambda=1600$ when the constant $\mu$ is set so that $\mu =1600/n^{4}$ to ensure comparability of the tuning parameter with the standard setting that is used in practical work with quarterly data. Thus, ((ref)) may be regarded as an asymptotic approximation to the trend output from HP filtering typical quarterly macroeconomic time series. The upshot is that when the HP filter is conducted under standard settings for $\lambda$, it fails to deliver a consistent estimate of an underlying stochastic trend in the data.

The limit formula on the right-hand side of ((ref)) is particularly convenient as a starting point in understanding the effects of repeated HP fitting. The following theorem confirms that, in contrast to ((ref)), the bHP filter $\widehat{f}_{t}^{\left(m\right)}$ captures the stochastic trend in the data when the number of iterations $m$ in the boosted filter is allowed to diverge and the primary tuning parameter setting is $\lambda=\mu n^{4}$.

thmSuppose that $x_{t}$ satisfies the functional limit law ((ref)) and the HP filter is iterated $m$ times according to the boosted HP algorithm with $\lambda=\mu n^{4}$ and $\mu$ fixed. If $m\to\infty$ as $n\to\infty$ then \begin{equation} n^{-1/2} \widehat{f}_{\left\lfloor nr\right\rfloor }^{\left(m\right)} \rightsquigarrow B(r). \end{equation}
description• {Remarks} • {(i)} This result shows that repeated application of the HP filter to the cyclical component residual from each pass of the filter is successful in asymptotically eliminating remnants of the stochastic trend from the estimated cyclical component of the time series. The bHP filter algorithm thereby assures consistent estimation of a stochastic process trend like Brownian motion. Importantly and distinct from the asymptotic result in PJ, consistent estimation of the stochastic process trend applies for the boosted filter even with the primary filter setting retained as $\lambda=\mu n^{4}$. This property is relevant in applications because the setting $\lambda=\mu n^{4}$ closely matches practical outcomes with the tuning parameter $\lambda=1600$ common in empirical research. Moreover, as simulations reported later in the paper show, the bHP filter turns out to be robust to variations in the choice $\lambda=1600$ for typical sample sizes in applied work. This robustness means that practitioners using our methods can employ standard HP algorithms in conjunction with the boosting iteration and the automated termination criteria discussed in Section (ref) below with some confidence concerning the robustness of the results. • {(ii)} The heuristic explanation of ((ref)) is as follows. Both series representations ((ref)) and ((ref)) converge almost surely and uniformly in $r$ and therefore admit further linear operations associated with the boosted filter. Successive operations of the filter then proceed to remove the remaining stochastic trend components from the cycle, leading to consistent estimation of the stochastic trend. The proof of the theorem makes use of the operator $G_{\lambda}= 1/[ \lambda L^{-2} (1-L) ^{4}+1]$, which is the asymptotic form (apart from end corrections) of the HP operator on the time series. As shown in PJ, the operator $G_\lambda$ may be interpreted as a pseudo-integral operator,\footnote{Pseudo-differential and pseudo-integral operators extend the conventional concept of differential and integral operators. For example, if $D=d/dx$ is the usual differential operator and $D^{-1}$ the integral operator, these definitions may be extended to include operators such as $D^{-z}$ for complex $z$ with $\Re(z)>0$ using the integral representation $D^{-z}f(x) =\Gamma(z)^{-1}\int_0^{\infty}e^{-Dt}f(x)t^{z-1}dt=\Gamma(z)^{-1}\int_0^{\infty}f(x-t)t^{z-1}dt$. Thus, when $f(x)=e^{ax}$ for some constant $a$, direct calculation yields the pseudo-derivative $D^{-z}e^{ax}=a^{-z}e^{ax}$. Much more general functional operators such as $g(D)$ may be represented under certain conditions in integral form using related Fourier integral transforms, see treves1980introduction and ross2006fractional. Similarly, matrix functional operator representation are possible phillips1987fractional. These methods are used by PJ in the derivation of (ref).} which facilitates the analysis of its asymptotic properties. The corresponding operator that delivers the cyclical component is $1-G_\lambda$ and $m$ successive operations in the boosted HP filter then lead to the operator $(1-G_\lambda)^m$. The asymptotic result is obtained by using the approximation $\left(1-G_\lambda \right)\varphi_{k}\left( t/n\right)\approx \mu / (\mu+\lambda_{k}^{2}) \cdot \varphi_{k}\left(t/n\right),$ which holds with a well-controlled approximation error. Repeated fitting leads to \begin{align} \left(1-G_\lambda \right)^{m}\varphi_{k}\left(\frac{t}{n}\right)\approx\left(\frac{\mu}{\mu+\lambda_{k}^{2}}\right)^{m}\varphi_{k}\left(\frac{t}{n}\right) \to 0, \quad as m \to \infty. \end{align} Then, $\left[1-\left(1-G_\lambda \right)^{m}\right] \varphi_{k}\left( \left\lfloor nr\right\rfloor / n \right) \approx \varphi_{k}\left(r\right)$, {as } $m,n \to \infty$. Pursuing this line of argument, the proof of Theorem (ref) establishes ((ref)) rigorously by verifying that the approximation errors accumulated throughout the series summation are asymptotically negligible. • {(iii)} When it is viewed as a special case of linear penalized spline smoothing, the HP filter places knots on the $n-2$ observed time points $x_t,\ t=2, \ldots, n-1$ omitting the first and last observations paige2010hodrick. The nonstationary nature of the knots in trending time series cases requires new technical tools in analyzing the asymptotic behavior of the boosting procedure. In this respect, the present results go beyond the scope of existing work, such as buhlmann2003boosting's Section 3.2 which is concerned with boosting nonparametric mean models based on penalized spline smoothing with fixed or iid knots.

We next proceed to consider the effect of boosting the HP filter when the time series involves a deterministic trend. PJ have shown that the HP filter itself asymptotically preserves a polynomial trend up to the 3rd order. In consequence, the bHP filter also asymptotically maintains the presence of a polynomial trend up to the 3rd order. The following result further shows that the bHP filter consistently estimates any higher order polynomial trends that may accompany a stochastic process trend in the data, as well as the limiting stochastic trend itself, thereby capturing the full limiting trend process.

thmLet $x_{t}=\alpha_{n}+\beta_{n,1}t+\cdots+\beta_{n,J}t^{J}+x_{t}^{0}$ where $x_{t}^{0}$ follows the functional limit law ((ref)) and the coefficients in the polynomial $\alpha_{n}/\sqrt{n}\to\alpha$, $n^{j-1/2}\beta_{n,j}\to\beta_{j}$ for $j=1,\ldots,J$. Suppose the HP filter is iterated $m$ times with $\lambda=\mu n^{4}$ and $\mu$ fixed. If $m,n\to\infty$, then \begin{equation} n^{-1/2} x_{\left\lfloor nr\right\rfloor }, n^{-1/2} \widehat{f}_{\left\lfloor nr\right\rfloor }^{\left(m\right)} \rightsquigarrow\alpha+\beta_{1}r+\cdots+\beta_{J}r^{J}+B\left(r\right). \end{equation}

The polynomial component of $x_t$ in Theorem (ref) is specified with sample size dependent coefficients, assuring that the standardized time series $ n^{-1/2} x_{\left\lfloor nr\right\rfloor } $ satisfies the functional law ((ref)), giving a limit stochastic process trend with polynomial drift of degree $J$. The result extends Theorem 4 of PJ by showing that boosting the HP filter with primary tuning parameter setting $\lambda=\mu n^{4}$ asymptotically preserves a polynomial trend of any finite order as $m \to \infty$. The implication is that when using the conventional $\lambda=1600$ setting of the smoothing parameter for quarterly macroeconomic time series, the boosting algorithm ensures that the filter delivers a consistent estimator of the limiting form of the trend in a time series that has a stochastic process trend with a finite order polynomial drift.

A closely related result might be expected in the case of boosting the HP filter applied to a time series that has a stochastic process limiting trend function accompanied by a deterministic drift that is piecewise continuous with a finite number of break points. Theorem 5 of PJ shows by using the Fourier series representation of the drift function that the asymptotic effect of the HP filter is to smooth a piecewise continuous limit drift function into a smooth curve in which the breaks in the deterministic trend are represented by smooth transitions over adjacent neighborhoods. In view of Theorem (ref), we might expect that boosting the HP filter would enable the filter under some conditions to capture the continuous parts of a polynomial trend as $m,n \to \infty$. The following result provides asymptotic theory and conditions for the case of a time series with a stochastic trend and time polynomial drift with a single break point.

To fix ideas, suppose $g_{n}\left( t\right) $ is a trend break polynomial with a single break point at $\tau _{0}=\lfloor nr_{0}\rfloor $ with $r_0 \in (0,1)$ that takes the form

equation*[equation* omitted — 286 chars of source]

with $\alpha _{n}^{\delta } / \sqrt{n} \rightarrow \alpha ^{\delta }$ and $ \{ n^{j- 0.5 }\beta _{n,j}^{\delta }\rightarrow \beta _{j}^{\delta }:j=1,..,J \} $ for $\delta =0,1.$ The limiting form of this polynomial break function is

equation*[equation* omitted — 271 chars of source]

giving a piecewise continuous polynomial function with a single break at $ r=r_{0} \in (0,1).$ If the generating mechanism of the observed data $x_{t}$ is $ x_{t}=g_{n}\left( t\right) +x_{t}^{0}$, where $x_{t}^{0}$ is a stochastic trend that satisfies the functional limit law ((ref)), then the normalized process $ n^{-1/2} x_{t=\lfloor nr\rfloor } $ has the following limit

equation[equation omitted — 127 chars of source]

as $n\rightarrow \infty $. PJ explore the asymptotic form of the HP filter applied to such a time series $x_{t},$ showing that when $\lambda =\mu n^{4}$ the limiting form of the normalized HP filtered time series is a smooth function $B_{g}^{\mathrm{HP}}(r):=g^{\mathrm{HP}}\left( r\right) +B^{\mathrm{HP}}(r)$ where $g^{\mathrm{HP}}\left( r\right) $ is a continuous function approximation to $g\left( r\right) $ that smooths over the break point of $ g\left( r\right) $ at $r_{0}$ and $B^{\mathrm{HP}}(r)$ is a smooth functional approximation to the Brownian motion $B\left( r\right) $ of the same form as ((ref)).

The following result shows that the bHP filter can consistently estimate the limit function $B_{g}(r)$ for $r\not=r_{0.}$, thereby capturing the polynomial drift function at all points except the break point, as well as the stochastic trend process.

thmLet $x_{t}=g_{n}\left( t\right) +x_{t}^{0}$ where $x_{t}$ satisfies $ n^{-1/2}x_{t=\lfloor nr\rfloor }\rightsquigarrow g\left( r\right) +B\left( r\right) .$ Suppose the HP filter is iterated $m$ times with $\lambda =\mu n^{4}$ and $\mu $ fixed. If $ 1/m + m/n \rightarrow 0$ as $n \to \infty$, then \begin{equation} n^{-1/2} \widehat{f}_{\left\lfloor nr\right\rfloor }^{\left( m\right) } \rightsquigarrow g^{ \mathrm{bHP} }\left( r\right) +B\left( r\right) :=\left\{ \begin{array}{cc} g\left( r\right) +B\left( r\right), & r \neq r_{0} \\ 0.5 \left\{ g\left( r_{0}^-\right) +g\left( r_{0}^+\right) \right\} +B\left( r_{0}\right), & r=r_{0} \end{array} \right. . \end{equation} for each $r\in \left[ 0,1\right]$ and $r_0 \in (0,1).$

Compared with Theorem (ref), this result imposes the additional condition that $ m / n \rightarrow 0$ as $m,n \to \infty$. The extra condition is useful in the proof in deriving the limit behavior of the boosted filter around the break point $r=r_0$. When $r \approx r_0$, the HP filter and boosted filter both smooth the time series trajectory of $x_t$ using observations on either side of the break point. Like the Fourier series approximation of a piecewise continuous function (and the Gibbs phenomenon), the HP filter and the boosted filter do not converge to the true value, $B_g(r_0)$, of the limit function at the break point $r=r_0$. PJ show that when $\lambda=\mu n^4$ the HP filter converges to a smoothed version of the limit process $B_g(r)$ for all $r \in (0,1)$. The above result shows that for the same tuning parameter setting of $\lambda$ the boosted filter provides a substantial enhancement by consistently estimating $B_g(r)$ for all $r \ne r_0$ in the limit as $m,n \to \infty$ when $ m/n \to 0$. An implication of this result is that the bHP filter provides a consistent estimate of the break point $r_0$ in an arbitrary polynomial trend. By consistently estimating $B_g(r)=g(r)+B(r)$ for all $r \ne r_0$ the boosted filter effectively reveals the break point $r_0$ by virtue of the fact that the deterministic limit function $g(r)$ has a finite right limit to the value $g(r_0^+)=g(r_0)$ on the right and has a finite left limit to a value $g(r_{0}^{-}) \ne g(r_0)$. The asymptotic form of $ n^{-1/2} \widehat{f}_{\left\lfloor nr\right\rfloor }^{\left( m\right)} $ captures this same behavior, showing that at the break point $r=r_0$ the limit of the bHP filter is the simple average of the left and right limits, viz., $ 0.5 \left\{ g\left( r_{0}^-\right) +g\left( r_{0}^+\right) \right\}$, thereby mimicking the behavior of the Fourier series representation of the function $g(r)$ at the break point $r_0$.

Theorem (ref) is proved for a polynomial of arbitrary finite order with a single break point. The proof of this theorem reveals that under the same conditions the result may be extended to any piecewise continuous polynomial function with a finite number of break points. In effect, the extended result shows that the bHP filter can consistently estimate a stochastic trend together with a breaking polynomial drift that has multiple structural breaks. Consistency applies for all points in the domain with the exception of the break points themselves. But in the same manner as Theorem (ref) the fact that consistency holds almost everywhere with exceptions at the break points ensures that the bHP filter delivers consistent estimates of the break points themselves. These results hold in the presence of discrete break points. The present asymptotic development does not provide for local break point departures with breaks that decay with the sample size. The analysis of the asymptotic properties of the bHP filter in such cases is left as a topic of future research.

Numerical Illustrations with the Boosted HP Filter

It is common for modern machine learning methods --- such as boosting, random forest and artificial neural network modeling --- to have multiple tuning parameters. The bHP filter has been formulated with two tuning parameters, one primary ($\lambda$) and one secondary ($m$). The near-universal choice for the primary smoothing parameter is $\lambda=1600$ for quarterly data and Theorems (ref) and (ref) show that with this choice, assuming that $\lambda=\mu n^4=1600$, the boosted filter can successfully consistently estimate and extract both stochastic and deterministic trends. As will be shown later in Section (ref), the bHP filter is robust to considerable variation in the initial setting $\lambda=\mu n^4=1600$. There is therefore good reason to continue using the standard value $\lambda=1600$ with quarterly data and to focus attention on a suitable choice for the secondary parameter $m$. This approach matches buhlmann2003boosting's recommendation of using a relatively large primary parameter for smoothing and designating the boosting parameter as the sole tuning parameter. This regularization method of terminating the algorithm after several iterations is called early stopping in statistical learning theory.

As the results of the last section show, the asymptotic effect of increasing $m$ is similar to reducing the value of $\lambda$ in the simple HP filter, as both approaches can lead to consistent estimation of stochastic trends. In particular, PJ's results imply that consistent trend estimation is restored if smaller values of $\lambda$ are used so that $\lambda/n^{4}$ shrinks to $0$ fast enough as $n\to\infty$. But implementing such a scheme would require a grid system $\left(\lambda^{\left(1\right)},\lambda^{\left(2\right)},\ldots,\lambda^{\left(m\right)}\right)$ to be specified and the performance of the HP filter over these choices to be monitored and evaluated by some other criterion. Such a regularization scheme itself is an iterative procedure that is conceptually no more appealing than early stopping and is difficult to implement absent suitable criteria for the selection process and supporting asymptotic theory. Instead, use of HP filter settings such as $\lambda=1600$ for initialization and iteration in the bHP algorithm enable practitioners to employ standard software, and the resulting robustness of the bHP filter to the initial setting of $\lambda$ (See Appendix (ref)) gives reassurance that the procedure is not reliant on arbitrary tuning parameter choices.

Macroeconomic time series are now available internationally in great abundance and computation is therefore a relevant consideration in all such big data applications when machine learning methods are employed aruoba2010globalization, aruoba2010real. A key computational advantage in the use of a bHP filter and early stopping procedure is its lower computational complexity and higher numerical stability in comparison to choosing $\lambda$ values on a grid system for the simple HP filter raskutti2014early, reiss2017optimal. Early stopping computes only once the inverse matrix operator $S=S\left(\lambda\right)=\left(I_{n}+\lambda DD'\right)^{-1}$ for a given $\lambda$. Using the same matrix $S(\lambda)$ stored in computer memory, successive iterations in the bHP filter involve simple matrix-scalar multiplication $(I_n - S(\lambda) ) \widehat{c}^{(m-1)}$, which amounts to $2n^2 - n$ linear operations. In contrast, searching for a suitable $\lambda$ on a grid system involves inverting an $n\times n$ matrix to obtain $S\left(\lambda\right)$ or carrying out QR decomposition\footnote{ Instead of directly computing the matrix inverse it is common to use a QR decomposition of the $(2n-2)\times n$ matrix $\left[I_{n}\ \brokenvert\ \lambda D \right]'$ to reduce computation cost. However, even for such a QR decomposition the leading term of the number of linear operations is $ (10/3) n^3$ by Householder transformation. } for every value of $\lambda$ on the grid, compared to which the computational cost of matrix-scalar multiplication is negligible.

figure[figure omitted — 669 chars of source]

We discuss various stopping rules for determining the number $m$ of boosting iterations in Section (ref) below. Before doing so, we conduct a numerical exercise to observe the effects of repeated fitting in three prototypical cases involving a stochastic trend, and a stochastic trend with a drift and a mean break. Let $u_{t}^{(z)}\sim \mathrm{iid\ } N(0,1)$ and $u_{t}^{(e)}\sim \mathrm{iid\ } N(0,1) $ be independent innovation sequences, and $g_n(t)$ be a deterministic sequence. Define

eqnarray[eqnarray omitted — 223 chars of source]

where $(z_t)$ is a random walk, $(e_t)$ is an ARMA(1,1) stationary process, $(\tilde{x}_t)$ is a trend consisting of a non-random drift component $g_n (t)$ and the stochastic trend component $z_t$, and $(x_t)$ is the observed time series, which allows for stationary deviations or measurement error in observations of $\tilde{x}_t$.

Given the same realized stochastic trend (measured with error) $x_t^0 = z_{t} + e_{t} $ of length $n=100$, we generate the observations $x_t = g_n (t) + x_t^0 $ shown in the panels of Figure (ref) by varying the deterministic component as follows to accommodate two prototypical trends:\footnote{The third prototypical trend is a simple stochastic trend with no deterministic component and results for this case are given in Table (ref) below.} a 4th order polynomial trend $ g_n(t) = 10^{-3} \cdot (n-t)^2 + 3 \times 10^{-7} \cdot t^4 $ in the upper panel, and a mean shift $g_n(t) = 20 \cdot 1\{t \ge 0.5n +1 \} $ in the lower panel. The observations $x_t$ are represented by the black scattered dots, the trend $\tilde{x}_t$ by the solid grey line, and the deterministic trend $g_n(t)$ by the dashed grey line. The HP filter with $\lambda=1600$ is used to extract the trend and is shown as the red curve ($m=1$) in the figure. The other curves are the fitted trends obtained by iterating the HP filter $m$ times (the $m$ values are given in the figure legend) according to the boosted filter.

The upper panel reveals that the repeated fitting tracks the random wandering behavior of the random walk uniformly better than the HP filter. The bHP filter gives a superior fit to the true trend (represented by the solid grey line in Figure (ref)) with a smaller $L_2$ distance to the grey line than the HP filter ($m=1$) for all values of $2 \le m \le 128$. The curves are insensitive to the number of iterations once $m$ becomes large. This phenomenon is known as boosting's `resistance to overfitting'.\footnote{Further evidence of resistance to overfitting is given later by Figure (ref) in the simulation study.} It is corroborated analytically in the proof of Theorem (ref) where it is shown that as $m$ becomes large for given $n$ the boosted filter stabilizes and approximates a finite number of terms in the orthonormal series representation of the limiting trend process. This finite term orthonormal representation is a smooth approximation to the true limit process, explaining the smooth form of the boosted HP filter. Further analysis of this example by decomposition of the component graphics is given in Figure (ref), which includes a comparison of the trend capture performance of the bHP filter with that of an AR(4) autoregression

In the lower panel, it is evident from the plots that boosting the filter goes a long way towards enhancing performance in the region of the structural break by eliminating a substantial amount of the transition smoothing in the HP filter around the break point. For large $m \approx n$, the boosted filter trajectory is strongly suggestive of a structural break around observation $t=50$ with a mid-point estimate of the value at the break point, corroborating the implications of Theorem (ref).

Stopping Criterion

The residual component after trend extraction by smoothing methods such as the HP filter has long been a building block for applied macroeconomists in studying business cycles and the interactions between macroeconomic aggregates and indicators. By definition, the cyclical component is a time series that exhibits no long run trending behavior, so that its spectrum has no unit root or deterministic trend asymptote at the zero frequency. In practice this criterion can be implemented by the elimination of all low frequency elements, an approach that band-pass filter methods use directly in filtering the data baxter1999measuring, christiano2003band,corbae2006extracting.

A natural and somewhat analogous approach in the present context is to refilter the data until there is no evidence of a non-stationary zero frequency asymptote. This can be conveniently achieved by monitoring the outcome of unit root tests on the residual series $\widehat{c}_{t}^{\left(m\right)}$. Standard procedures for unit root testing such as the augmented Dickey-Fuller (ADF) or Phillips-Perron phillips1988testing tests can be used and the boosting iterations can be continued until the test statistic is smaller than a specified $p$-value, such as 0.05 or 0.01. Such test-based stopping criteria are easy to implement and are well-tailored to existing applied macroeconomic practice, echoing kozbur's test-based stopping criterion for forward selection, and diebold2000unit's test-based forecasting approach. Relatedly, HP (1997) use unit root tests to assist in determining an appropriate setting for the primary smoothing parameter $\lambda$. In our simulations and empirical examples, we will use the ADF test conducted with significance level 0.05 to illustrate implementation of this approach. The boosted HP filter that results from this ADF test-based selection will be denoted bHP-ADF.

Information criteria offer an alternative approach to a stopping criterion. These criteria are routinely employed in statistics to achieve bias-variance trade-offs and to prevent overfitting in modeling and forecasting. We therefore consider the following BIC for the selection of the stopping time for $m$

equation[equation omitted — 266 chars of source]

Similar to BIC, this criterion penalizes fit by adding $\log(n)$ times a term that quantifies the relative weight of the $m$ additional iterations that are involved in the boosted filter. The first term of ((ref)) measures the residual sum of squares fit of the boosted HP filter, $\widehat{c}^{\left(m\right)\prime}\widehat{c}^{\left(m\right)}$, relative to the HP filter itself, $\widehat{c}^{\mathrm{HP}\prime}\widehat{c}^{\mathrm{HP}}$. The penalty term involves the usual $\log(n)$ scale factor multiplied by a ratio that measures the effective degrees of freedom of the boosted filter after $m$ iterations to the effective degrees of freedom of the HP filter. To interpret this ratio, it is useful to think of the linear operator $\left(I_{n}-S\right)$ that produces the residual cyclical component $\widehat{c}^{\mathrm{HP}}=\left(I_{n}-S\right)x$ of the HP filter as analogous to a linear regression projector or hat matrix, so that $\mathrm{tr}\left(I_{n}-S\right)$ is analogous to the degrees of freedom in the sample after projection. The operator $B_{m}=I_n-(I-S(\lambda))^m$ is the $m$-fold operator corresponding to the boosted filter and the quantity $\mathrm{tr}(B_m)$ may therefore be interpreted in a similar way as the effective degrees of freedom after successive fitting by the boosted HP. This interpretation corresponds to usage in the machine learning literature tutz2006generalized. It is convenient from now on to refer to the criterion $IC\left(m\right)$ simply as BIC and to the bHP filter that results from this selection rule as bHP-BIC. .

It is shown in the Appendix that $\mathrm{tr}(B_m)$ can be asymptotically approximated by the following simple analytic expression as $n \to \infty$

equation[equation omitted — 257 chars of source]

Figure (ref) graphs $\mathrm{tr}(B_m)$ against this approximation as a function of $m$, showing how the penalty term coefficient $\mathrm{tr}(B_m)$ increases monotonically and nonlinearly with $m$ for any given value of the sample size $n$. Differentiating ((ref)) with respect to $m$ gives

equation*[equation* omitted — 261 chars of source]

so that $\mathrm{tr}(B_{m} ) $ is increasing in $m$ with decreasing derivative as $m$ increases, as is evident in Figure (ref). Moreover, as is clear from formula ((ref)) and the graph, the penalty coefficient $\mathrm{tr}(B_m) \to 2$ as $\lambda \delta_{k}^2 \to \infty$, which happens for all $k=\lfloor nr\rfloor $ with $r\in (0,1]$ and $m$ fixed when $\lambda = \mu n^4$. Thus, the impact of the penalty on the choice of $m$ is attenuated as $n \to \infty$.

figure[figure omitted — 296 chars of source]

With the implementation of one of these stopping rules, the boosted HP fitting algorithm is automated and data-determined, making it ready for practical use like other non-parametric procedures with data-determined bandwidth selectors. The following sections assess the performance of these stopping rules in simulated experiments and provide three real data applications.

table[table omitted — 751 chars of source]

As a numerical illustration for the data displayed in Figure (ref), the deviation of the estimated trend $\widehat{f}_t$ from the underlying trend $\tilde{x}_t$ is measured in terms of the mean squared error (MSE) calculated as $\mathbb{M}_n = (n-8)^{-1} \sum_{t=5}^{n-4} (\widehat{f}_t - \tilde{x}_t)^2 $. The end points are trimmed in $\mathbb{M}_n$ to accommodate start-up in the AR(4) process and end points in the HP filter. Calculating the MSE using $\mathbb{M}_n$ without trimming did not materially affect the results. In this particular experiment, both ADF and BIC significantly reduce the MSE of the HP filter while AR(4) evidently does not fit the underlying trend well. For further analysis and more detailed graphical displays see Figure (ref) in Appendix (ref).

Simulations

We conduct simulation exercises with eight data generating processes to observe the finite sample performance of the bHP filter in practice when the trend process involves both stochastic and deterministic elements. Similar to the models used in Section (ref), in DGPs 1 and 2 below we add a stationary component to the deterministic trends. With the addition of this component to the data iterating an excessive number of times in the boosting process in finite samples can potentially lead to overfitting. The experimental design therefore reveals the bias-variance tradeoff that occurs in such cases and the effectiveness of the two stopping criteria in preventing saturation fitting in practical applications of the boosted filter.

DGPs 3-8 focus on fitting a trend under alternative plausible generating mechanisms that include a pure random walk, a structural break, a sinusoidal trend, a cosine cycle, and various combinations of these components. The experiments also provide performance comparisons of the boosted filter approach to trend extraction with the autoregressive model estimation approach advocated in hamilton2017you.

The Bias-Variance Tradeoff in Boosting

According to Theorem (ref), the boosted HP filter can asymptotically remove any finite-order polynomial drift, whereas the HP filter can only handle a polynomial drift up to the 3rd order. Higher order time polynomials are known to be useful in modeling the nonlinear growth of both macroeconomic and microeconomic time series and as sieve approximations to more general nonlinear trend functions (baek2015testing; cho2018sequentially). We are therefore interested in the capability of the boosting mechanism to enable the HP filter to capture these general deterministic trend elements in addition to stochastic trends.

The following two experimental designs involve finite degree polynomial drift functions, $g_n (t)$, to accompany the stochastic trend generating mechanism as in ((ref)). The specification illustrates the potential gains that can be obtained in trend determination by boosting the HP filter even in the presence of simple deterministic drifts.

figure[figure omitted — 688 chars of source]
description• Set the sample size $n=100$ (25 years in quarterly data), and the deterministic trend $ g_n (t)= 0.0005 t^3 $. Step 1: Generate a stochastic trend plus drift process $ \tilde{x}_t = g_n(t) + z_t$ as defined in ((ref)). Step 2: Given the realized trend $ \tilde{x}_t $ in Step 1, simulate the stationary random component $e_t$, also defined in ((ref)), to produce the measured observation $x_t = \tilde{x}_t + e_t$. Step 3: Repeat Step 2 for 50 times (calling this the inner loop) in order to compute the bias and variance of the filters given the trend $\tilde{x}_t$. Step 4: Repeat Steps 1-3 for 1000 replications (we call this the outer loop) to average the bias and variance over the various realizations of the trend process. • This experimental design is identical to DGP 1 except for the fact that the deterministic trend component is generated by a 4th order polynomial $ g_n (t) = 5 \times 10^{-6} \cdot t^4$ rather than a 3rd order polynomial.

Given a realized $\tilde{x}_t$, in the inner loop of 50 replications we compute for fixed $t$ and $m$ the empirical versions of the bias $\mathbb{B}^{(m)} = E [ \widehat{f}_{t}^{(m)} ] - \tilde{x}_t $ and the variance $\mathrm{var} [ \widehat{f}_{t}^{(m)} ] $. Then over the realized trend trajectory $ \tilde{x} = (\tilde{x}_t)_{t=1}^n $ we calculate the squared-bias $\mathbb{Q} ^{(m)} = n^{-1} \sum_{t=1}^{n} \left[ \mathbb{B}^{(m)} \right] ^2 $ and the variance $ \mathbb{V}^{(m)} = n^{-1} \sum_{t=1}^{n} \mathrm{var} [ \widehat{f}_{t}^{(m)} ] $. Finally, in the outer loop for each $m$ we average over the 1000 replications of $\mathbb{Q} ^{(m)} $ and $\mathbb{V} ^{(m)} $. The squared bias and the variance are displayed in the left subgraph of Figure (ref) for each $m=1,\ldots,40$. The black dotted line above the bars sums the underlying two bars and gives the mean squared error (MSE).

In both DGPs, similar patterns of bias-variance tradeoff are evident. Initiating the iteration process from the HP filter ($m=1$), we observe a sizable drop in the squared bias and MSE in the first few iterations of boosting. The squared bias continues to decrease as the iterations proceed, whereas variance slowly increases. After it reaches a minimum, the MSE remains insensitive as a rather flat curve as $m$ continues to grow, which reflects the boosting saturation that occurs in finite samples.

To evaluate the effect of the data-driven stopping criteria, we save the number of iterations in each instance and take the sample average in the inner loop. The outer loops provide 1000 such average stopping times and histograms of these average stopping times are shown in the right subgraph of Figure (ref). In DGP 1 the 3rd-order polynomial trend can be asymptotically removed by fitting the HP filter only once. Setting the test size to be 0.05, we find that only 25.9 percent of the average ADF stopping times are smaller than two, indicating that some remnants of the stochastic trend appear in the residual cyclical component with nontrivial probability. The BIC criterion requires at least two iterations in all replications and often three or four fittings. The effect of these fittings is evident in the large reductions in the squared bias as observed in the left panel.

The stopping time data is more intriguing in DGP 2 where we replace the cubic trend of DGP 1 by a 4th-order time polynomial. According to the limit theory, without the use of boosting the HP filter cannot asymptotically remove such a higher order polynomial trend. This asymptotic theory is clearly supported in the finite sample computations. The bottom-right subgraph of Figure (ref) shows that the average ADF stopping criterion is at least two and the BIC criterion requires at least three fittings and often as many as four or five.

figure[figure omitted — 420 chars of source]

Goodness of Trend Determination

In the previous subsection, DGPs 1 and 2 were designed as mechanisms to produce a polynomial trend plus a stochastic trend. Whatever the precise nature of the trend, conditional on its realized form computations of the bias and variance of the bHP filter reveal the tradeoff that occurs in these measures of fit as the number $m$ of iterations in the boosted filter rises. As the results with DGPs 1 and 2 show, bias typically falls quickly as $m$ begins to rise, demonstrating immediate gains from boosting. But with increasing $m$ bias reductions diminish and variance rises to a point where mean squared error stabilizes. Thus, in finite samples there are limits to what can be accomplished by boosting just as in any nonparametric procedure.

Many empirical studies model time series data in terms of integrated or near-integrated processes augmented with various complementary mechanisms such as polynomial drifts, similar drifts with breaks, sinusoidal trends, or trends induced by time varying coefficients, all of which are intended to improve harmony with the observed data but with no certainty concerning the true specification of its generating mechanism. This section considers the performance of the bHP filter in such cases and compares the performance of the bHP filter with hamilton2017you's alternative recommendation of the use of autoregressive (AR) modeling with a small number of lags, typically an AR(4) which is expected to be well suited to quarterly data applications.

The following six models are used to illustrate the performance characteristics of these approaches. The pure random walk case is used as a baseline in DGP 3 and DGPs 4-6 couple this integrated process with various other complementary trend specifications that progressively enhance the complexity of the generating mechanism. DGPs 7-8 employ a specific fixed-period cyclical component. The notation follows the framework of ((ref)) and sample size is set to $n=100$.

description• The observed time series is $x_t^{(3)} = z_t$, a random walk with independent Gaussian increments. • Real economic activity may involve long duration cycles that are time-dependent and evolve in a non-replicative manner, for example with varying magnitudes or cycle lengths. We use a deterministic sinusoidal trend of the form $g_n(t) = 5 t^{1/5} \cos( 0.05\pi t^{0.9} ) $ to embody this type of complexity. Figure (ref) graphs the form of various expanding and decaying sinusoidal trends of this type. The observed time series is expressed in the form $x_t^{(4)} = g_n(t) + x_t^{(3)}$. • This model serves as a simple prototype of GDP takeoff that can be used to represent a successful emerging economy growth trajectory. The model has a structural break in the middle of the sample and takes the form $$x_t^{(5)} = u^{(z)}_{t} \cdot \mathbf{1}\{t < 0.5n \} + \big( t-0.5n + \sum_{s=0.5n}^t u^{(z)}_s \big )\cdot \mathbf{1}\{t \geq 0.5n \} . $$ The first half of the sample is a stationary sequence and the second half is an integrated process with a linear upward drift. • This model is formed from the composition of the deterministic sinusoidal trend $g_n(t) = 5 t^{1/5} \cos( 0.05\pi t^{0.9} ) $ of DGP 4 with the structural break model in DGP 5 leading to the time series $x_t^{(6)} = g_n(t) + x_t^{(5)}$. • This model is the same as DGP 4 except that the deterministic component $g_n(t)$ is replaced by the periodic function $\check{g}_n(t) = \cos\left(\pi t/2\right)$ which repeats every 4 periods. • In DGP 6 $g_n(t)$ is replaced by $ \check{g}_n(t) \cos\left(\pi t/2\right)$.

The goal in the simulation exercise is to determine the trend from data generated by these different mechanisms using the HP filter, the bHP filter, and the AR(4) regression technique of hamilton2017you. In each replication the observed time series is filtered or regressed to obtain the corresponding fitted trend estimate $\widehat{f}_t$. Deviation from the underlying trend $\tilde{x}_t$ is measured in terms of the MSE calculated using $\mathbb{M}_n$ as that in Table (ref). The trend processes $\tilde{x}_t$ are produced from the generating processes prescribed above so that $\tilde{x}_t^{(3)} = x_t^{(3)}$, $\tilde{x}_t ^{(4)} = g_n(t) + \tilde{x}^{(3)}$, $\tilde{x}_t^{(5)} = ( t-0.5n + \sum_{s=0.5n}^t u^{(z)}_s )\cdot \mathbf{1}\{t \geq 0.5n \}$, and $\tilde{x}_t ^{(6)} = g_n(t) + \tilde{x}^{(5)}$ for DGPs 4--6, respectively. In DGPs 7 and 8, the deterministic function $ \check{g}_n(t) = \cos\left(\pi t/2\right)$ is periodic and does not exhibit trending behavior when $n \gg 4$. We therefore take this function as a component of the cycle. So, the trends in DGP 7 and DGP 8 are simply $\tilde{x}_t^{(7)} = \tilde{x}_t^{(3)} $ and $\tilde{x}_t ^{(8)} = \tilde{x}^{(5)}$.

table[table omitted — 916 chars of source]

Table (ref) reports the empirical average of $\mathbb{M}_n$ and the observed number of iterations in the bHP filter over 5000 replications. In DGP 3, where the time series is generated from a random walk, the fitted AR(4) is particularly well suited since the regression model includes the true generating mechanism. Unlike the AR(4) regression which is based only on past information in forecasting the trend, the two-sided nature of the HP filter uses all sample information, including future observations to determine the current period trend value. There are notable differences in the results between the ADF selected and BIC selected stopping times for the iteration. These differences reveal the importance of iterating the filter. The BIC selector leads to a substantially lower MSE in trend determination from the boosted filter. The ADF selector tends to stop the iteration too early to achieve optimal improvement with an average number of iterations of 1.23, which is close to the HP filter itself (with $m=1$) and substantially lower than the average number of 9.49 iterations for the BIC selector. With the BIC selector the bHP filter provides a substantial reduction in MSE over the HP filter. The bHP-BIC filter also produces a smaller MSE to the underlying trend than the AR(4) regression, an interesting result given that the AR(4) regression model encompasses the simple random walk model DGP 3 and the bHP has none of these explicit features.

The HP filter methods are all nonparametric in nature and, as the asymptotic theory suggests, when the tuning parameters are chosen appropriately these methods can adapt to complex trend processes and generating mechanisms. The simulation evidence supports this theory. In particular, once a slowly moving smooth deterministic trend is added to the random walk in DGP 4, the differences in performance are magnified and the MSE of the AR(4) regression deteriorates more than the bHP-BIC filter. Interestingly, the presence of a deterministic trend triggers more iterations in the bHP-ADF filter and it reduces the MSE to 1.47 from the value 1.50 in DGP 3.

Since the first half of the DGP 5 sample is a white noise for which the constant level trend function is easy to predict in a nonparametric method, the filter methods each obtain a smaller MSE than their counterparts in DGP 3. However, as a global parametric method, the AR(4) regression is inevitably misspecified when this structural break from an I(0) to an I(1) process is present in the observed series. In this case, the MSEs of the bHP-ADF and bHP-BIC filters are both substantially smaller than that of the AR(4). DGP 6 raises the level of trend complexity further by including an evolving sinusoidal trend. For this DGP, the boosted filter again provides much better trend determination. In fact, bHP-BIC has MSE less than half that of the AR(4). Comparison of the results for DGP 4 and DGP 6 shows that bHP provides a very effective tool that adapts well to increasing complexity in the underlying trend mechanism. The HP filter, on the other hand, has MSE that is almost three times the size of that of the bHP-BIC filter.

The results for DGPs 7 and 8 in Table 2 reveal that the MSE of trend estimation by bHP-BIC are substantially smaller than those of the AR(4) with a difference greater than $0.43$ in both cases. These results show that the bHP estimated trend correctly excludes the cosine function. The $0.43$ difference between the MSEs of bHP-BIC and AR(4) for DGP 7 is roughly the naive `sample variance' $s_w^2= n^{-1} \sum_{t=1}^nw_t^2-(n^{-1} \sum_{t=1}^nw_t)^2 =0.50$ of the periodic function \{$w_t:=\cos\left(\pi t/2\right)$, $t=1,\ldots,n=100$\}. In effect, bHP-BIC treats the cosine function correctly as a cyclical component, which it is with sample size $n=100 \gg 4$, whereas AR(4) regression does not make this distinction leading to the larger MSEs in trend determination. For DGP 7, the average number of iterations for bHP-ADF is 1.42 giving MSE results close to those of the HP filter which shows that bHP-BIC, with an average of 5.43 iterations in this case, is more effective in refining HP.

Empirical Examples

We illustrate the effects of using the bHP filter in three real data examples. The first example revisits empirical support for Okun's law across 20 OECD countries. The second explores business cycle behavior in a panel of 78 heterogeneous time series covering emerging and developed markets with various degree of persistence and volatility. The third studies the behavior of the filters in trend determination using US industrial production data over the past century. In this last application we use the HP and bHP filters as well as the AR(4) parametric approach.

Okun's Law

figure[figure omitted — 319 chars of source]

Okun's law okun1962potential posits an empirical association between output and the unemployment rate that has received wide attention among practicing economists and policy makers as well as academic economists and authors of undergraduate economics texts. For the United States, Okun's law is stated as relating a 1 percent increase in GDP (relative to potential GDP) to a 0.5 percent reduction in the unemployment rate (relative to the natural rate of unemployment). Following the original formulation by Okun, ball2017okun specify the empirical model in terms of the following empirical regression equation

equation[equation omitted — 113 chars of source]

where $U_{t}$ is the unemployment rate, $Y_{t}$ is the logarithm of GDP, and $U_{t}^{*}$ and $Y_{t}^{*}$ are the natural rate of unemployment and the potential GDP. The sign and the magnitude of $\beta$ signify the direction and strength of the relationship. In view of its potential policy implications, Okun's law has been extensively tested over time and cross countries. Most recently, ball2017okun testify to its robustness in 20 advanced economies. These authors, as many others, estimate the long-run levels of $U_{t}^{*}$ and $Y_{t}^{*}$ by means of the HP filter under the primary parameter setting $\lambda=100$ for annual data. Equation ((ref)) is therefore a simple regression between two cyclical components produced by the HP filter.

The primary motivation of using trend extraction techniques prior to the regression ((ref)) is to focus on cyclical variates. A secondary motivation is to eliminate the possibility of spurious regression in the variables, which would distort inference granger1974spurious, phillips1986understanding unless there is strong justification for residual stationarity and a cointegrating relationship between the variables. Use of the ADF test in the implementation of the boosted filter assists in addressing both these issues and rationalizing the regression.

figure[figure omitted — 258 chars of source]

We collect annual GDP data from the OECD (OECD.stat) and annual unemployment rates from the World Bank. We follow ball2017okun in studying the same 20 economies over the period 1980 to 2016. The dataset is mostly balanced, except for a few countries with 1 or 2 missing values at the beginning of the time period. We maintain the primary parameter setting of $\lambda=100$ for the simple HP filter, and we apply the bHP filter based on the same tuning parameter $\lambda$. For each country, Figure (ref) reports the OLS coefficient estimate of $\beta$ in the upper panel, and the regression $R^2$ in the lower panel. The regressions are conducted with cyclical components extracted by the simple HP filter (shown by red bars), the boosted HP filter with iterations stopped by (i) ADF test outcomes at the 5 percent level (shown by green bars), and (ii) use of the information criterion ((ref)) (shown by blue bars).

For most countries, the fitted coefficients and $R^2$ are similar across the filtering methods. For example, in United States the coefficient is approximately -0.5, and $R^2$ is around 0.8. These figures accord with established results for the USA and the recent findings of ball2017okun. In particular, the results from using the boosted filter tend to confirm the conclusion of the latter authors that `Okun's law is a strong relationship in most countries'.

One country where there is a surprisingly large contrast among the methods is Ireland, where the equation $R^2$ is $0.71$ after simple HP filtering but only 0.10 after bHP-ADF filtering and 0.43 after bHP-BIC filtering. To explore these differences, we display the relevant data for Ireland in Figure (ref). The upper panel graphs the estimated cyclical components of GDP obtained by HP, bHP-ADF and bHP-BIC. The red line produced by the HP filter shows a long upward trend from the mid 1990s to 2007, followed by a sustained slump until 2013. These trends are evident in the data from inspection and it is apparent that the HP filter fails to remove them in estimating the cycle. In fitting the boosted filter using the ADF procedure to select the boosting tuning parameter 19 iterations of the filter were needed, the largest number of iterations among all the 40 series in this experiment. The associated cyclical component is represented by the green line. This GDP cyclical component fluctuates around the mean in a smaller range, shows no evidence of a residual trend, and it appears much more stable than the cycle determined by the HP filter. The shape of the cycle obtained by using BIC selection is very similar after $m=5$ iterations.

The lower panel displays the three fitted curves of the (negative) unemployment rate for Ireland. The negative rate is used in the figure to better visualize the association with the GDP fitted cycles shown in the upper panel. For the unemployment rate series, the boosted filter is stopped by ADF after 2 iterations and by BIC after 5 iterations. In both cases, the use of repeated filtering clearly mitigates residual trend behavior in the unemployment rate in comparison with the HP filter. The mitigation is more evident in the case of bHP-BIC filtering where the fitted cycle in the unemployment rate appears even more regular than after bHP-ADF filtering, especially during the aftermath of the 2007-2008 financial crisis. These adjustments in the fitted cycle from bHP filtering appear not to reduce the evident association with the GDP cycle and the fitted regression coefficients after bHP filtering indeed have similar values, as shown in the upper panel of Figure (ref).

In sum, this application continues to support the robustness of Okun's law across developed countries, thereby reinforcing the conclusion of ball2017okun. But the results also expose the insufficiency of the standard HP filter to remove stochastic trend components in the case of Ireland. Repeated fitting in this case helps to isolate the cyclical component in each time series.

International Business Cycles: Emergent and Developed Economies

The HP filter was originally motivated in HP (1997) through its usefulness in the empirical study of business cycles in the USA. In an influential paper with a similar thematic concerning international evidence of business cycles, aguiar2007emerging find that emerging markets (represented by 13 economies) in general are more persistent in the cyclical components of the three series they consider (GDP, consumption and investment) than those of the developed markets (represented by another group of 13 countries). In summarizing their study they declared that `[for emerging markets] the cycle is the trend.'

We revisit this conclusion using the methods of the present paper to analyze the same data that the authors provide online.\footnote{Downloadable at \url{https://scholar.harvard.edu/gopinath/pages/data-and-codes}.} Within each country, the three time series have the same length but across countries the length of the time series varies considerably. For example, the median length is 52 quarters for the emerging economies, with Argentina the shortest (1993Q1\textendash 2002Q4, 40 quarters), whereas the median is 94 quarters for the developed countries, with Australia, Finland, Netherlands and Norway the longest (1979Q3\textemdash 2003Q2, 95 quarters). The authors established their empirical results after HP-filtering all 78 time series with the standard setting $\lambda=1600$. As discussed earlier in the paper, the analysis in PJ shows that the implied penalty from using this standard setting is heavier for shorter time series, making stochastic trend identification difficult in international comparisons with series of differing lengths. As our asymptotic theory shows, the bHP filter provides a mechanism for adapting the standard setting to account for shorter and longer sample sizes. We employ the iterated procedure to the logarithm of GDP, consumption and investment to study whether the cyclical patterns noted by aguiar2007emerging in the two groups of countries remain distinguishable.\footnote{aguiar2007emerging report the moments after processing the cyclical components in a macroeconomic structural model. We directly work with the raw data here to keep the comparison as simple and straightforward as possible.}

table[table omitted — 1,305 chars of source]
figure[figure omitted — 333 chars of source]

For each of the 78 time series, we apply the HP filter and automated bHP filters, all with the same $\lambda=1600$ setting, to extract trend and save the cyclical component. In general, the emerging economies need more iterations than the developed countries to isolate trend, manifesting the differences in persistence. Table (ref) displays within each group of 13 countries the medians of the number of iterations, standard deviations, and correlation coefficients. The standard deviations typically become smaller as boosting progresses, while the relative magnitude between the emerging and developed markets remains stable. Similar relative sizes are observed in the correlation coefficients. The repeated filtering changes absolute values, but the relative magnitudes of the volatility and persistence are largely maintained in the two groups of countries.

Figure (ref) shows the cyclical components of each time series, with the developed nations in green and the emerging nations in black. Despite the small number of iterations involved, the bHP-ADF filter provides noticeably greater smoothing of the time series. With only a few more iterations taken by the bHP-BIC filter, the cyclical components appear more stable around the mean. The contrast in the volatility of the two groups of countries is strongly manifest in the graph. Overall, this application of the boosted filter therefore confirms that aguiar2007emerging's findings are robust when machine learning methods are used to assist in compensating for the differing lengths of the time series across countries.

US Industrial Production Index

In this final application of our methods, we analyze a single macroeconomic time series of industrial production that has visually evident trend and (somewhat irregular) cyclical components over a long historical period. The US industrial production index used here is an indicator of aggregate economic activity that measures real production output of manufacturing, mining, and utility industries based on hundreds of individual time series. The series is seasonally adjusted, covers the last century from 1919:Q1--2018:Q2, and comprises 398 observations. It is one of the longest US quarterly macroeconomic series available from the Federal Reserve data base.\footnote{ Downloadable at \url{https://fred.stlouisfed.org/series/IPB50001SQ}. }

figure[figure omitted — 415 chars of source]
figure[figure omitted — 411 chars of source]

In Figure (ref), the black dots plot the logarithm of the raw time series. The shaded regions are the recessions dated by NBER, where both the Great Depression and the recent Great Recession are clearly visible. The index is very volatile before the Second World War. Following the Second World War, fluctuations around the upward path of the index moderate but occur regularly until the end of the 20th century. Figure (ref) zooms in on the more recent and more dramatic period of 21st century experience over 2000:Q1--2018:Q2.

It is common for macroeconomists, for example romer1999changes, to study the many changing features of long time series of this type by analyzing subperiods and comparing their defining characteristics across such periods. The HP filter approach, as well as other forms of trend extraction, seeks a unified econometric representation of the trend component of the entire series. The HP filter in Figure (ref)(a) is created with smoothing parameter setting $\lambda = 1600$, and this filter accordingly smooths out the peaks and valleys of the index.\footnote{bHP-ADF is stopped after one iteration and thereby producing the same result as the HP filter. It is discussed in Section (ref). } The bHP-BIC filter, shown in Figure (ref)(b), involves 7 iterations. Compared to the HP filter, it is more responsive to the downturn of industrial production during the episode of the financial crisis.

Figure (ref) zooms in the period after 2000. The HP filter completely ignores the dot-com bubble collapse in 2001-2002 whereas the bHP-BIC filter declines in 2001, indicating an impact of this collapse on trend and with the residual deviations (the bHP cycle) corresponding closely to the NBER dated 2001 recession shown by the shaded area of the graph. The bHP filter subsequently reflects the serious impact of the Great Recession on the upward trend path of production, matches the first part of the NBER dated 2008-2009 recession, and extends the recession period to 2010. As a measure of potential industrial production, the estimated impact on trend from the boosted HP filter is more consistent with the fundamental deterioration that many macroeconomists, such as krugman2012, perceived to have occurred in the aftermath of the financial crisis.

Figures (ref)(c) and (ref)(c) report additional findings from the alternative AR(4) approach. During both crashes in the first decade of the 21st century, the AR(4) fitted trend overshoots the extremes of the realized observations both before the burst of the financial bubble and at the end of the collapse that produced the downturn in the real economy that is reflected in the production index. This phenomenon is a typical feature of highly autoregressive (near unit root) fitting. In the present case the fitted AR(4) has long run autoregressive coefficient $0.9978$ which is virtually unity.\footnote{ The estimated coefficients of the AR(4) model intercept and the first to fourth lags are $0.011, 1.421, -0.514, 0.216$ and $-0.1252$, respectively. The long run autoregressive coefficient, based on the sum of the four autoregressive coefficients, is $0.9978$. The characteristic polynomial has roots $[0.6123,0.9959, -0.0936\pm0.4433 \mathbf i]$ and the complex roots correspond to a damped (amplitude $0.4531$) cycle of $4.61$ quarters or $1.15$ years. The seasonally unadjusted industrial production series was also analyzed and produced very similar results to those given here, so they are not reported.} Autoregressive fitting of time series tends to capture the fine grain as well as the global features of a time series trajectory, thereby removing most of the variation in the time series and reducing the residual closer to a series with martingale difference characteristics (see also Figure (ref)(c) in Appendix B). This approach seems too rigid in its goal of removing variation to separate slow moving trend components from irregular cyclical and stationary elements in time series. In particular, as this example demonstrates, the AR approach seems unable to effectively differentiate between trends and cycles in the economic environment, especially during episodes of extraordinary change that impact both trend and cyclical elements in economic activity. In the present case, the slow economic recovery following the crisis may be viewed as a distinguishing feature of the great recession cycle and the overall downturn that was induced may be considered as an inevitable impact on the trend krugman2012.

table[table omitted — 404 chars of source]

Our assessment of these findings of trend and cycle extraction with a century-long time series is that the bHP-BIC filter works well during periods of normal growth and mild cyclical activity and is also capable of capturing more complex heterogeneous features of the downturns in trend and slow variable recovery from the major recessions that arose in earlier and later years of this long historical period.

This application reveals some major differences between the filter and autoregressive approaches to cycle estimation. Table (ref) shows the sample variance of the fitted cyclical components. In the first row of the table, it is clear that the autoregression has very small residual variance, amounting to approximately one half of that of the cyclical residual of the bHP-BIC filter and one quarter of that of the HP filter residual. This substantial gain in fitting the time series so well compared with the filtering methods arises from the capacity of the autoregression to capture a stochastic trend component in the time series parametrically (effectively by means of a near-unit root autoregression --- here with a long run autoregressive coefficient 0.9978 that is so close to unity) --- and to employ a parametric damped cycle of amplitude $0.4531$ with period around 1.15 years that is induced by a pair of complex autoregressive roots in the characteristic equation of the autoregression. This fitted cycle has high frequency and is much closer to representing a damped seasonal oscillation in the production series than a business cycle, even though the time series that is used here is seasonally adjusted.

A more dramatic illustration of the forecast-oriented and fit-driven nature of the autoregression is apparent with a simple one-period phase shift. In particular, if we move the observed time series one period forward, then in the second row of the table the sample variance of $(x_{t+1} - \widehat{f}_t)$ is only about 20 percent that of the unshifted fit in the first row. Thus, the AR(4) is far better at predicting past values than future values of the trending trajectory, just as may be expected from a unit root autoregression fit of a far more complex time series trajectory. Such a one-period-ahead forecasting mechanism is highly effective in reducing residual variation. But this success in the AR mechanism can compromise its role in capturing more slowly varying (multi-period) trend effects in a time series that involve features over many time periods. Of course, by construction, the parametric AR(4) filter is fundamentally different from the HP filter and has different traditional modeling goals, such as forecasting using past information and studying the impact of past shocks on the system variable.\footnote{In his pioneering study of business cycles in the United States between 1919-1932, tinbergen1939business employed a fourth-order difference equation to describe the `systematic cyclical forces' in the US economy, analyzing the amplitude and period of the cycle, which turned out to be 4.8 years. Tinbergen claimed that the influence of further lags was `found to be small', a conclusion that matches the recommendation of hamilton2017you in using the AR(4) approach. In our present example, there is some evidence that extending the number of lags is beneficial in capturing in-sample fluctuation. Use of an AR(6), for example, reduces the residual variance of 1.298 (shown in the first row of Table (ref)) of the AR(4) to 1.087. Further, autoregressive lag determination by the standard BIC criterion clearly prefers AR(6) ($\mathrm{BIC} = -6.75$) to AR(4) ($\mathrm{BIC}=-6.58$) for the industrial production time series. The roots of the characteristic equation of the estimated AR(6) are $\{0.0256, 0.9971, -0.3934 \pm 0.6608 \mathbf i, 0.6360 \pm 0.4128 \mathbf i\}$, in which the two sets of complex roots indicate damped cycles of periods $1.51$ years and $2.73$ years.}

By comparison, phase shifting in the case of the HP and bHP-BIC filters leads naturally to deterioration in residual variation. As seen in the table, the sample variance grows in the second row of the table for both HP filters. This is explained by the fact that these filters are designed as nonparametric penalized and smoothly varying best fits to each individual observation in the time series trajectory, taking into account what is happening in neighboring observations. Such a mechanism seems more closely aligned with the general objective of historical trend determination when the concept of trend is based on the hypothesis articulated by Hodrick and Prescott (1997) in the header quotation that `the growth component of aggregate economic time series varies smoothly over time'.

Conclusion

This paper explores the use of a machine learning modification of the HP filter that is designed for trend extraction in studying business cycles in macroeconomic data. The algorithm is based on the idea of repeated HP filtering and is linked to $L_2$-boosting methods that are now commonly used in machine learning approaches to linear regression. The boosted HP filter allows empirical investigators to continue to use a primary tuning parameter setting such as the standard $\lambda=1600$ setting for quarterly data applications but alleviates the concern of using a single choice of this parameter in filtering time series of various lengths and persistence. To enhance the asymptotic performance of the HP filter, the boosted filter introduces a secondary tuning parameter that controls the degree of boosting while holding the primary parameter $\lambda$ fixed at customary levels such as 1600 for quarterly data. In practical applications, data-determined methods that rely on nonstationarity tests or information criteria may be used to select this secondary parameter in a convenient way. Asymptotic theory shows that the boosted HP filter has the capacity to consistently estimate, and thereby remove, a stochastic trend with time polynomial drift as well as a stochastic trend with deterministic polynomial drift and multiple structural breaks. These results seem relevant for many empirical applications in which standard HP tuning parameter settings are currently used.

The limit theory reveals some of the capabilities of HP filter methods as trend fitting and extraction processes for practical work that have heretofore been little understood. The methodology allows empirical researchers to rely on existing software for standard implementation of the HP filter in the boosting environment. Like ordinary least squares and vector autoregressions, empirically convenient methods such as the HP filter are unlikely ever to be put out of business, in spite of concerns that have been repeatedly raised over many years about their usefulness and their effects on subsequent analysis.

It is hoped that the present contribution will help empirical researchers to better understand the capabilities and limitations of the HP filter and to guide the implementation of a simple machine-learning vehicle for its improvement in applications, thereby mitigating some of the limitations of the HP filter itself. Our position is therefore more optimistic than that of hamilton2017you. As we have shown, a key advantage of the boosted filter is that it provides a new device for consistently estimating in a nonparametric manner a wide class of trending mechanisms including processes that involve structural breaks, while remaining agnostic about the precise form of the trend nonstationarity in the data. These are central advantages of the boosted filter that justify some optimism, support continuing empirical use, and clearly distinguish the methods from competitor approaches that are typically reliant on correct model specification.

To close the paper, we provide a summary response based on our present findings to the recent critique of the HP filter by hamilton2017you, which takes up a long tradition of critiquing the HP filter as a tool of applied macroeconomics. Hamilton specifically argues for disuse of the HP filter on the following grounds: (i) it induces spurious cycles; (ii) it is inappropriate for a random walk; (iii) it is two-sided, giving future-informed predictions; (iv) a long autoregression, such as an AR(4) should be used instead. We consider each of these points in turn.

Point (i) repeats the central thesis of cogley1995effects. The possible presence of spurious cycles in the residual is explained by the asymptotic theory of Theorem 3 of PJ and the smoothness of the limiting form of the filter for popular choices of the smoothing parameter. But point (i) no longer holds if the HP filter consistently estimates the trend function. In particular, Section 5 of PJ shows that much slower expansion rates than $O(n^4)$ for the smoothing parameter do lead to consistent estimates of stochastic and deterministic trend functions. Moreover, the present paper demonstrates that consistent estimation of a wide class of such trends is possible even with popular choices of the smoothing parameter by `boosting' the HP filter using machine learning techniques. Point (ii) is invalid when the HP filter consistently estimates the limiting stochastic process corresponding to a random walk or a more general stochastic trend. Again, as shown in PJ, suitable choices of the smoothing parameter in relation to the sample size achieve consistent estimation of many limiting stochastic process trend functions; and, further, methods such as boosting can accelerate this convergence to the true function, as shown here. Point (iii) is correct. Like a fixed design nonparametric regression, the HP filter smooths observations on either side of the current observation. So it is true that the HP filter in its standard form is not intended as a predictive device. As Whittaker explained in his original formulation, the goal of the penalized likelihood formulation is to find the `most probable' function, which in this case is the trend function. The HP filter is a trend detection device that seeks to determine the `most probable trend' using clear probabilistic principles. Notwithstanding this primary goal of the filter, one sided filtering can be used recursively for prediction and the methods of PJ and the current paper, which show how the filter may be represented in terms of a series of smooth functions can be modified to produce predictive techniques. Point (iv) offers an alternative. We have analyzed the performance of an autoregressive approach to trend and cycle determination in our numerical and empirical work, where the findings show a clear preference for the bHP filter over autoregression.

We end this paper with a more general response to the proposal of using autoregressions for trend and cycle determination. Autoregressions are widely used in applied economic research and represent a valid modeling approach. But as trend elimination and cycle determination mechanisms autoregressions have limitations. These seem worthy to report in detail. Much of the motivation for using long autoregressions stems from their capacity to capture a wide class of data generating mechanisms, motivated by inversion of the Wold representation in the stationary case and by unit root or near unit root fitting in nonstationary cases via the long run autoregressive coefficient. These valid properties coupled with convenience of implementation have sustained their extensive use in applied work over many decades. Nonetheless, autoregressions are unable to consistently estimate trends of a general form beyond simple polynomials via the inclusion of intercepts and polynomial time trends in their formulation. Further, by virtue of their potential in approximating the Wold representation of the stationary component in a time series, long autoregressions tend to produce residuals whose properties approximate martingale difference innovations, a feature that has led to their extensive use in the identification and analysis of policy shocks. Accordingly, the residuals from fitted autoregressions provide poor approximants of cyclical behavior for which temporal dependence, rather than absence of correlation, is a critical element. Finally, while autoregressions may naturally generate cycles from complex conjugate dynamic roots, such induced cycles are necessarily characterized by regularity, a fact that stands in contrast to the properties of macroeconomic data where both the period and intensity of business cycles and recessions are so noted for their irregularity that these features are embodied in the many popular descriptive terminologies that are given to them, among which we may mention the terms great depression, great moderation, great recession, short sharp recession, and long recovery. There are no doubt many others.

In counterpoint to a long autoregression, what the HP filter does and what the boosted filter of this paper does even better is to find the most probable trend, one of sufficient generality that the residuals may take many different forms, thereby accommodating time series that can capture a potentially wide class of cyclical downturns and expansions. As the graphical demonstrations in Appendix (ref) show, the bHP filter is robust to the choice of the tuning parameter $\lambda$ used in fitting the initial HP filter allowing investigators to proceed with standard settings such as $\lambda=1600$ for quarterly data. With the number of iterations in the bHP data-determined by BIC or ADF testing, the bHP filter is easy to use in practical work and has consistent asymptotic properties for a wide range of trend processes. For all these reasons it is our view that the HP filter and boosted enhancements may validly be used as helpful empirical devices in the search for trend and cycle in applied econometric work.

To implement the automated boosted HP filters in practical work, we have developed documented R, Matlab, Python and Julia functions along with test examples to assist empirical researchers. These programs may be downloaded from the following website \\ \url{https://github.com/zhentaoshi/Boosted_HP_filter}.