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.
134,369 characters · 26 sections · 154 citation commands
The Macroeconomy as a Random Forest
}
\thispagestyle{empty}
\setcounter{page}{1}
The rise of Machine Learning (ML) led to great excitement in the econometrics community. In applied macroeconomics, a first wave of papers took ML algorithms off the shelf and went hunting for forecasting gains. With the emerging consensus that some ML offerings can appreciably increase predictive accuracy, a question emerges: what is the place of economics in all that?
The conditional mean is the most basic input to any empirical macroeconomic analysis. Anything else that follows (e.g., structural analysis) depends on it. Thus, getting it right is not merely useful, it is necessary. Clearly, in that regard, ML can help. However, while the latter gladly delivers prediction accuracy gains (and ergo a conditional mean closer to the truth), it is much more reluctant to disclose its inherent model. Consequently, ML is currently of great use to macroeconomic forecasting, but of little help to macroeconomics. I propose a simple remedy: shifting the focus of the algorithmic arsenal away from predicting $y_t$ into modeling $\beta_t$, which are economically meaningful coefficients in a time-varying macroeconomic equation. The newly proposed algorithm, Macroeconomic Random Forest (MRF) kills two coveted birds with one stone. First, in most instances, MRF forecasts better than off-the-shelf ML algorithms and traditional econometric approaches. Second, its main output, Generalized Time-Varying Parameters (GTVPs), can be interpreted. Their versatility comes from nesting many popular specifications (structural breaks/change, threshold effects, regime-switching, etc.) and letting the data decide whichever combination of them is most suitable. Ultimately, we get a new methodology leveraging the power of ML and big data to provide a modern take on the decades-old challenge of estimating latent states driving linear macroeconomic equations.
\vskip 0.15cm
{\sc The State of Empirical Macro Affairs.} Answering positively two questions guarantees a viable conditional mean: "are all the relevant variables included in the model?" and at a higher level of sophistication, "is linearity a valid approximation of reality?". The first one led to the successful development of factor models and large Bayesian Vector Autoregressions (VARs) over the last two decades. To address the second, applied macroeconomic researchers have proposed many non-linear time series models based on reasonable economic intuition. Most of them amount to have regression coefficients $\beta_t$ in $$y_t = X_t \beta_t +\varepsilon_t$$ evolving through time. The $\beta_t$ process can take many forms, and a choice must be made a priori out of many equally plausible alternatives. Notable members of the vast time-variations catalog are threshold/switching regressions hansen2011TAR, smooth transition terasvirta1994, structural breaks perron2006,stock1994unit, and random walk time-varying parameters sims1993,cogley2001evolving,primiceri2005. While it is uncontroversial that factor models and large Bayesian VARs have gone a long way in meeting their original goals, less victorious statements are available for the various time-variation proposals. Why?
More often than not, nonlinear time series models use little data and/or restrict stringently the shape of $\beta_t$'s path. While the consequences for forecasting are direct and obvious, those for analysis of macroeconomic relationships are equally problematic. Is the evolving Taylor rule characterized by switching regimes simszha2006, a Volker structural break clarida2000, or gradually evolving parameters boivin2005has,primiceri2005? This discordance interferes with our understanding of the past while impacting our expectations for tomorrow's $\beta_t$. I now divide popular time-variation approaches into two strands, discuss their shortcomings, and complete by explaining how MRF addresses them.
\vskip 0.15cm {\sc Observable Time-Variation Via Interaction Terms.} Using interaction terms and related refinements is a parsimonious way to create time variation in a linear equation. For instance, switching regimes based on an observed regressor can be obtained by interacting the linear equation with the indicator function $I(q_t>c)$, where $c$ is some value, and $q_t$ is a threshold variable chosen by the researcher. However, using the FRED-QD US macro data set mccrackenng reveals an overwhelmingly large number of candidates for $q_t$. Additionally, there may be multiple regimes interacting together. Or the "true" $q_t$ could be an unknown function of available regressors. And structural breaks or slow exogenous variation could get in the way. The list goes on. This renders a credible exploration of the threshold structures' space impossible and the enterprise of manually specifying the model very much compromised.
Here is an empirical example. auerbach2012measuring and rameyzubairy2018 use a GDP/unemployment indicator to let the effects of fiscal stimulus (potentially) vary with the state of the economy. batini2012successful allow for additional dependence on the origin of the impulse (revenue or spending). Such honorable explorations could go on endlessly. MRF provides a hammer solution to the problem. First, the near-universe of threshold structures can be characterized by regression trees --- see section (ref). Second, MRF embeds, among other things, a powerful greedy algorithm designed to explore such "structure" spaces.
\vskip 0.15cm
{\sc Latent Time-Variation.} Some methods with an aura of greater flexibility are labeled as "latent change". In this line of work, $\beta_t$ either follows a law of motion (random walk, Markov process) or could be subject to discrete breaks.\footnote{Simpler derivatives are often used in applied work. In forecasting, rolling-window estimation drops early observations. In empirical macro, pre-defined subsamples are popular clarida2000,del2020s.} At first glance, this appears to solve many of the problems of interaction terms approaches. By treating $\beta_t$ as a state to be filtered/estimated within the model, the complexity of characterizing its path correctly out of abundant data seems to vanish. Alas, estimating $\beta_t$'s path implies a great number of parameters \citetext{in fact, often greater than the number of observations, GC2019} which inevitably necessitates strong regularization. That regularization is the law of motion itself, a choice far from innocuous -- and akin to that of $q_t$ in "observable" change models. Accordingly, whether it is latent regime-switching, exogenous breaks, or slow change, none can easily accommodate for the additional presence of the other. Yet, these models are routinely fitted separately on the same data. Consequently, methods often detect what they are designed to detect, in near-complete abstraction of imaginable interference from other nonlinearities.
Additionally, while "latent" approaches may sometimes rationalize the data well in-sample, many of them will struggle to outperform a simple benchmark out-of-sample. Often, the very nature of $\beta_t$'s law of motion creates forecasting headaches. Classical TVPs imply a two-sided vs one-sided filtering problem. Analogously, detecting a structural break is much harder without a great amount of data on both sides of it. Moreover, there is the obvious problem of statistical efficiency. If the Phillips curve flattened because an economy became increasingly open, including an interaction term with imports/exports is wildly more efficient than obtaining the whole $\beta_t$ path non-parametrically. Thus, exogenous structural change should be, in some sense, a time variation of last resort. The advantage of MRF is that it algorithmically search for "observable" low-hanging fruits, and turn to split the sample with $t$ only if necessary. Further, it implicitly creates a forecasting function for $\beta_t$ which is an RF in its own right. This is, almost in any case, much more powerful than existing alternatives -- like random walks.
\vskip 0.15cm
{\sc Mechanics.} The key difference when adding the M to MRF is the inclusion of a linear part within each of the tree leaves, rather than just an intercept. Motivated in cross-sectional applications to improve the efficiency of nonparametric estimation (in the spirit of local linear regression), trees with linear parts have been considered (among others) in treed and modeltrees. friedberg2019llf expand on this by considering an ensemble of them (i.e., a forest) and focusing on the problem of treatment effect heterogeneity. Of course, the difference here is that a linear part is much more meaningful when one can look at $\beta_t$ as a process of its own -- and as a synthesis of nonlinear time series models. Finally, it is noteworthy that the approach may come in semiparametric partially linear clothing, yet it makes no compromise on the range of nonlinearities it captures. This is a virtue of time-varying coefficients models being able to approximate any nonlinear function granger2008.
The paper also introduces new devices enhancing MRF's predictive and interpretability potential. First, I propose Moving Average Factors (MAFs) as a simple way to compress ex-ante the information contained in the lags of a regressor entering the RF part of MRF. They boost the meaningfulness of tree splits and helps avoid running out of them quickly. The transformation is motivated by the literature on constraining/regularizing lag polynomials shiller1973. Precisely, MAFs' contribution is to induce similar shrinkage when there are no explicit coefficients to shrink. When it comes to GTVPs themselves, I provide a regularization scheme better suited for time series which procures a desirably smoother path with respect to time. It is inspired by the random walk shrinkage of the classical TVP literature and is implemented within the tree procedure by weighted least-squares. Finally, a variant of the Bayesian Bootstrap provides credible regions that are instrumental for the interpretation of GTVPs.
\vskip 0.15cm {\sc Results.} In simulations, the tool does comparably well to traditional nonlinear time series models when the data generating process (DGP) matches what the latter is designed for. When the time-variation structure becomes out of reach for classical approaches, MRF wins. Additionally, it supplants plain RF whenever persistence is pervasive. In a forecasting application, the MRFs gains are present for almost all variables and horizons under study, a rarity for nonlinear forecasting approaches. For instance, the Autoregressive Random Forest (ARRF) almost always supplant its resilient OLS counterpart. Also, an MRF where the linear part is a compact factor-augmented autoregression generates very accurate forecasts of the 2008 downturn for both GDP and the unemployment rate (UR). Inspection of resulting GTVPs reveals they behave differently from random walk TVPs. For instance, in the UR equation, the contribution of forward-looking variables nearly doubles before every recession --- including 2008 where the associated $\beta_t$ is forecasted to do so out-of-sample. This reinforces the view that financial indicators and other market-based expectations proxies can rapidly capture downside risks around business cycle turning points adrian2019. MRF learned and applied it to great success.
Inflation is subject to a variety of time-variations, detection of which would be compromised by approaches lacking the generality of MRF. The long-run mean and the persistence evolved slowly and in an exogenous fashion --- this has been repeatedly found in the literature \citetext{e.g., cogley2001evolving}. More novel is the finding that the real activity factor's effect on the price level depends positively on the strength of well-known leading indicators, especially housing-related. Following this lead, I complete the analysis by looking at a traditional Phillips' curve specification. I report that the inflation/unemployment trade-off coefficient decreased significantly since the 1980s and also varies strongly along the business cycle. Among other things, it is extremely weak following every recession. This nuances current evidence on the flattening Phillips curve, which, by design, focused almost entirely on long-run exogenous change blanchard2015inflation,galigambetti2019, del2020s. Overall, MRF suggests inflation can rise from a positive unemployment gap, but it goes down much more timidly from economic slack. These findings are made possible by combining different tools within the new framework, such as credible intervals for the GTVPs, new variable importance measures specifically designed for MRF, and surrogate trees as interpretative devices for $\beta_t$.
\vskip 0.15cm
{\sc Outline.} Section (ref) introduces MRF, motivates its use, considers practical aspects, and discusses relationships with available alternatives. Sections (ref) and (ref) report simulations and forecasting results, respectively. Section (ref) analyzes various GTVPs of interest. Section (ref) concludes.
This section introduces MRF. I first motivate the use of trees as basis functions by casting standard switching structures for autoregressions as special cases. Second, I detail the MRF mechanics and how it yields GTVPs. Third, I discuss how the approach relates to both standard RF and traditional random walk TVPs. Fourth, I discuss interpretability potential and provide a way to assess parameter uncertainty.
Within the modern ML canon, Random Forest (RF) is an extremely popular algorithm because it allows for complex nonlinearities, handles high-dimensional data, bypasses overfitting, and requires little to no tuning. This is in sharp contrast with, for example, Neural Networks, whose ability to fail upon a bad choice of hyperparameters is largely unmatched. Thus, RF is a reasonable device to look into for constructing GTVPs. But there is more: many common time series nonlinearities fit within a tree structure. Hence, it will be all the more natural to think of MRF as a generalization of previous nonlinear offerings. Overall, it eliminates the arbitrary search for a specification. By creating a unified view, the myriad of time-variations suggested separately can now be tackled jointly.
I now present two examples displaying how common time series nonlinearities imply a tree structure for an AR process. Let us consider the inflation process in a country where inflation targeting (IT) was implemented at a publicly known date (like in Canada). Let $\pi_t$ be inflation at time $t$ and $t^*$ is the onset date of IT. Additionally, $g_t$ is some measure of output gap. A plausible model is reported in the tree graph below. The story is straightforward. Inflation behaved differently before vs after IT. After IT, it is a simple AR process. Before IT, it was a switching AR process which dynamics and mean depended on the sign of the output gap.\footnote{Note that a standard regression tree would set all $\phi$'s to 0.}
\Tree[.{Full Sample} [.{$t<t^*$} [.{$g_{t-1}<0$} {$\pi_t = c_1 + \phi_1 \pi_{t-1}+\epsilon_t$} ] [.{$g_{t-1} \geq 0$} {$\pi_t = c_2+ \phi_2 \pi_{t-1} +\epsilon_t$} ] ] [.{$t \geq t^*$} {$\pi_t = c_3 + \phi_3 \pi_{t-1} +\epsilon_t$} ] ]
This is one story out of many that trees can characterize. In practice, none of the above is known. The structure, the splitting variables, and the splitting points could be different. This is both good and bad news. It highlights the flexibility of trees. It also suggests that designing the "true" one from economic deduction is a daunting task --- equally plausible alternatives are easily imaginable. Fortunately, algorithms can point out which trees in better agreement with the data.
A global grid search is computationally unfeasible if either $S_{t}$ is large or if we want to consider more than a few splits (examples above included 2 and 3, respectively). A natural way forward is recursive partitioning of the data set via a greedy algorithm breiman1984classification.\footnote{A single autoregressive tree was proposed in meek2002art.} A greedy algorithm optimizes functions by iteratively doing the best local update, rather than directly solving for a global optimum. As a result, it is prone to high variance ESL. Hence, considering a diversified portfolio of trees appears as the most sensible route. To achieve that, it is highly effective to use Bootstrap Aggregation \citetext{Bagging, breiman1996bagging} of many de-correlated trees. This is the famous Random Forest proposition of breiman2001.
The general model is
where $S_{t}$ are the state variables governing time variation and $\mathcal{F}$ a forest. $S_t$ is oberved macroeconomic data which composition is motivated in section (ref) and laid out explicitly in section (ref). $X$ determines the linear model that we want to be time-varying. Typically, ${X_t}\subset S_t$ is rather small (and focused) compared to $S_t$. For instance, an autoregressive random forests (ARRF) -- which generalizes the cases of the previous section -- uses lags of $y_t$ for $X_t$. The tree fitting procedure underlying plain RF is not adequate, as it sets $X_t=\boldsymbol{1}$ by default. Thus, analogously to friedberg2019llf, it is modified to
The purpose of this problem is to find the optimal variable $S_j$ (so, finding the best $j$ out of the random subset of predictors indexes $\mathcal{J}^{-}$) to split the sample with, and at which value $c$ of that variable should we split.\footnote{Note that, unlike friedberg2019llf, $S_t$ and $X_t$ will differ, which is natural when motivated from a TVP perspective (but not so much from local linear regression one). Forcing their equivalence is not feasible nor desirable in a macro environment.} It outputs $j^*$ and $c^*$ which are used to split $l$ (the parent node) into two children nodes, $l_1$ and $l_2$. We start with the leaf $l$ being the full sample. Then, we perform a split according to the minimization problem, which procures us with 2 subsamples. Within each of these two newly created subsamples, we run (ref) again. Repeating this process recursively constructs an ever-growing set of $l$'s which are of ever-shrinking size. Doing so until a stopping criteria is met generates a tree.
\vskip 0.15cm {\sc Let the Trees Run Deep.} Recursively splitting $\beta_0$ into $\beta_1$ and $\beta_2$ eventually leads to $\beta_t$. However, $\beta_t$, by construction, has very little company within its terminal node/leaf. As result, a single tree has low bias, but also very high variance for $\beta_t$. When fitting a single tree, the (early) stopping point must be tuned to avoid overfitting. However, this is not necessary when a sufficiently diversified ensemble of trees is considered. Originally, breiman2001 himself provided a bound on the generalization error that grows with the correlation between trees.\footnote{Also, duroux2016impact derive a formula (for a "median" forest) linking tuning parameters related to the depth of the trees and that of diversification.} In MSoRF, I go further by showing that RF's out-of-sample prediction is equivalent to the optimally "stopped" or "pruned" one, provided sufficiently diversified trees. The desirable property is attributed to the peculiar behavior of "randomized greedy algorithms", which are often overlooked as mere computational necessities. Those insights are of even greater use when it comes to time series since dependence and structural change pose challenges to hyperparameter tuning. Given a large enough $B$, a reasonable mtry (see "De-Correlation" below on this) and standard subsampling rate, we can be confident that the out-of-bag prediction and $\beta_t$'s exclude fitted noise. In our specific context, it means the sample will not be over-split, and we are not going to see time variation when it is not there. Naturally, the credible regions proposed in section (ref) will also help in that regard. The property will be illustrated in section (ref).
(M)RF prediction is the simple average from those of its single trees. Same goes for $\beta_t$. RF is a clever diversification scheme which generates sufficient randomization for that average to inherit the above properties. To achieve that, it mixes elements of re-sampling and model averaging: Bagging and de-correlated trees.\footnote{See MSoRF for a discussion on how RF compares and contrast with the forecast combinations/averaging literature.}
\vskip 0.15cm {\sc Bagging.} Each tree is "grown" on a bootstrapped sample (or a random subsample) breiman1996bagging.\footnote{This does not preclude from obtaining $\beta_t$ for all $t$'s since $\beta_t$'s attached to the excluded observations are simply generated by applying the tree on the "out-of-bag" data.} When the base learner is highly nonlinear in observation and/or unstable, gains from Bagging can be large breiman1996bagging,grandvalet2004bagging. Nonparametric \citetext{or "pairs" mackinnon2006bootstrap} bootstrap is being used --- i.e., we are not shuffling residuals.\footnote{Nonetheless, Bagging in itself is not estranged to macro forecasting inoue2008useful,hillebrand2010benefits,hillebrand2020bagging. However, nearly all studies consider the more common problem of variable selection via hard-thresholding rules -- like t-tests lee2020bootstrap.} Rather, we are randomly selecting many observations triples $[y_t \enskip X_t \enskip S_t]$ (or pairs $[y_t \enskip S_t]$ for Plain RF), and then fit a tree on them. To deal with the dependence inherent to time series data and other reasons detailed in section (ref), a slightly more sophisticated bootstrapping/subsampling procedure (involving blocks) will be used for MRF.
\vskip 0.15cm {\sc De-Correlation.} The second ingredient, proposed in breiman2001, is to consider "de-correlated" trees. RF is an average of many trees, and any averaging scheme reduces variance at a much faster rate if its components are uncorrelated. In our context, this is obtained by growing trees semi-stochastically. In equation (ref), this is made operational by using $\mathcal{J}^- \subset \mathcal{J}$ rather than $\mathcal{J}$. In words, this means that at each step of the recursion, a different subsample of regressors is drawn to constitute candidates for the split. This prevents the greedy algorithm (which, as we know, only "thinks" locally) to always embark on the same optimization route. As a result, trees are further diversified and computing time, reduced. The fraction of randomly selected predictors is a tuning parameter typically referred to as mtry in the literature (and all software), with a default value of $\frac{1}{3}$ for regression settings. This, other algorithmic parameter settings, and some practical aspects are discussed in appendix (ref).
Plain RF has many qualities readily transferable to MRF. It is easy to implement and to tune. That is, it has few tuning parameters that are usually of little importance to the overall performance -- robustness. It is relatively immune to the adverse effects of including many irrelevant features ESL. Given the standard ratio of regressors to observations in macro data, this is a non-negligible advantage. Furthermore, with a sufficiently high mtry, it can adapt nicely to sparsity and discard useless predictors olson2018making. Finally, its vanilla version already shows good forecasting performance for US inflation medeiros2019 and macro data in general chen2019off,GCLSS2018.
Equation ((ref)) uses Ridge shrinkage which implies that each time-varying coefficient is implicitly shrunk to 0 at every point in time. $\lambda$ and the prior it entails can exert a significant influence. For instance, if a process is highly persistent (AR coefficient lower than 1 but nevertheless quite high) as it is the case for SPREAD (see section (ref)), shrinking the first lag heavily to 0 could incur serious bias. Fortunately, this can easily be refined to a Minnesota-style prior if $X_t$ corresponds to a Bayesian VAR equation. If $X_t$ is low-dimensional (as it will often be), a simpler alternative consists in using OLS coefficients as prior means. Nonetheless, the specification of previous sections implies that if $\lambda$ grows large, $\forall t \enskip \beta_t=0$ (or whatever the prior mean is). $\beta_i=0$ is a natural stochastic constraint in a cross-sectional setting, but its time series translation $\beta_t=0$ can easily be suboptimal. The traditional regularization employed in macro is rather the random walk $$\beta_t=\beta_{t-1}+u_t.$$ Thus, it is desirable to transform ((ref)) so that it implements the prior that coefficients evolve smoothly (at least, to minimal extent), which is just shrinking $\beta_t$ to be in the neighborhood of $\beta_{t-1}$ and $\beta_{t+1}$ rather than 0. This is in line with the view that economic states (as expressed by $\beta_t$ here) last for at least a few consecutive periods. Note that unlike traditional TVP methods which rely extensively on smoothness regularization -- as it is the sole regularizer, MRF makes only an very mild use of it to get rid of high-frequency noise that may be left in $\beta_t$. The main benefit is to facilitate the interpretation of resulting GTVPs.
I implement the desired regularization by taking the "rolling-window view" of time-varying parameters, which has been exploited recently to estimate large TVP-VARs giraitis2018inference,petrova2016quasi. That is, the tree, instead of solving a plethora of small ridge problems, will rather solve many weighted least squares problems (WLS) which includes close-by observations. The latter are in the neighborhood (in time) of observations within current leaf. They are included in estimation, but are allocated a smaller weight.
For simplicity and to keep computational demand low, the kernel used by WLS is rather rudimentary: it is a symmetric 5-step Olympic podium. Informally, the kernel puts a weight of 1 on observation $t$, a weight of $\zeta<1$ for observations $t-1$ and $t+1$ and a weight of $\zeta^2$ for observations $t-2$ and $t+2$. Since some specific $t$'s will come up many times (for instance, if both observations $t$ and $t+1$ are within the same leaf, podiums overlap), I take the maximal weight allocated to $t$ as the final weight ${w(t;\zeta)}$.
Formally, define $l_{-1}$ as the "lagged" version of leaf $l$. In other words, $l_{-1}$ is a set containing each observation from $l$, with all of them lagged one step. $l_{+1}$ is the "forwarded" version. $l_{-2}$ and $l_{+2}$ are two-steps equivalents. For a given candidate subsample $l$, the podium is
where $\zeta<1$, a tuning parameter guiding the level of time-smoothing. Then, it is only a matter of how to include those additional (but down weighted) observations in the tree search procedure. The usual candidate splitting sets $$l_1(j,c) \equiv \{ t \in l | S_{j,t} \leq c \} \quad \text{ and} \quad l_2(j,c) \equiv \{ t \in l| S_{j,t}>c \}$$ are expanded to include all observations of relevance to the podium $$\text{for } i=1,2: \quad l_i^{RW}(j,c) \equiv l_i(j,c) \enskip \cup \enskip l_i(j,c)_{-1} \enskip \cup \enskip l_i(j,c)_{+1} \enskip \cup \enskip l_i(j,c)_{-2} \enskip \cup \enskip l_i(j,c)_{+2}. $$ The splitting rule becomes
Note that the Ridge penalty is kept in anyway, so the final model has in fact two sources of regularization. With $\zeta\rightarrow0$, we are heading back to pure Ridge.
Although not considered in the main applications of this paper, models with a larger linear part $X_t$ are possible. For instance, one could estimate, equation by equation, a high-dimensional VAR. In practice, this simply requires harsher regularization via higher values of $\lambda$, $\zeta$ and a larger minimum leaf size. Nevertheless, the forecasting benefits from this strategy could prove limited: MRF is "high-dimensional" whenever $S_t$ is large. The time-varying constant in MRF is a RF in its own right. It can be seen as a complex misspecification function (in the deep learning jargon, it is effectively called the bias) that adaptively controls for omitted variables in a way that is both non-linear and strongly regularized via randomization. Consequently, the cost from omitting a regressor of minor importance in $X_t$ is low since it can be picked up by the time-varying intercept.
Of course, the small $X_t$ strategy treats the extra regressors as exogenous, which could be at odds with some researchers' will to investigate a large web of impulse response functions. Anyhow, both approaches are possible. The dynamic coefficients of a (large) GTVP-VARs can be estimated by either fitting MRF equation by equation, or modifying the splitting rule in (ref) to be multivariate so that each tree is fitted jointly for all equation -- pooling time-variation across equations. Finally, elements of the covariance matrix of residuals can be fitted separately with a plain RF, which is very fast.
GTVPs have many advantages over classical TVPs. While it is known that any nonlinear model can be approximated by a linear one with TVPs granger2008, nothing is said about how efficient that estimation is going to be. As it turns out, efficiency crucially matters in a macro context, and random-walk TVPs can be quite inefficient aruoba2017dsge. For example, if the true $\beta_t$ follows a recurrent switching mechanism, random walk parameters already have two strikes against them. Some dimensionality reduction techniques -- like reduced-rank restrictions dewindgambetti2014,stevanovic2016common,chan-ftvp2018,GC2019 -- can help, but nothing in that paradigm can come close to the parsimony of simply interacting $X_t$ with relevant variables. In contrast, MRF considers all time-variations options, and choose the "obvious thing", which may or may not be splitting on $t$. Also, it is absolutely possible that the resulting $\mathcal{F}$ pools both latent and observable time variation.
Even though MRF is remarkably flexible, its variance remains low thanks to the diversified portfolio of trees. The variance of classical TVPs can be controlled by cross-validation GC2019 or via an elaborate hierarchical prior amir2018choosing. A number of applications opt for a "manual" approach AAG2013. However, it is understood that no tuning, however careful it may be, can overcome the hardship of fitting random-walks when the true $\beta_t$'s look nothing like it.
Econometrically, one way to more formally connect this paradigm to recent work on TVPs is to adopt the view that RF are adaptive kernel estimators meinshausen2006,athey2019grf,friedberg2019llf. That is, the tree ensemble is a machine generating kernel weights. Once those are obtained, estimation amounts to weighted least squares (WLS) problem with a Ridge penalty. By running ((ref)) recursively, one obtains terminal nodes/leaves $L_{b}()$ to construct kernel weights $$ \alpha_{t}\left(\mathrm{x}_{0}\right)=\frac{1}{B} \sum_{b=1}^{B} \frac{1\left\{\mathrm{X}_{\mathrm{t}} \in L_{b}\left(\mathrm{x}_{0}\right)\right\}}{\left|L_{b}\left(\mathrm{x}_{0}\right)\right|} $$ to use in
As shown in GC2019, standard random walk TVPs are in fact a smoothing splines problem, and for those, a reproducing kernel exists dagum2009. giraitis2014inference drop the random walk altogether and proposed to use kernels directly. Anyhow, in both cases, the only variable entering the kernel is $t$. In other words, only proximity in time is considered for the clustering of observations. This makes the seemingly flexible estimator in fact quite restrictive -- and dependent on its inherent smoothness prior. Moreover, standard kernel methods are known to break down even in medium dimensions (say <10 variables) friedberg2019llf. Therefore, augmenting $t$ -- the sole variable in the kernel (implicit of explicit) of traditional TVP methods -- with additional regressors is not an option. No such constraints bind on the RF approach.
The standard RF is a restricted version of MRF where $X_t=\iota$, $\lambda=0$ and $\zeta=0$. In words, the only regressor is a constant and there is no within-leaf shrinkage. Previous sections motivated MRF as a natural generalization of non-linear time-series models. At this point, a reasonable question emerges from a ML standpoint. Why should we prefer the partially linear MRF to the fully nonparametric RF? One reason is statistical efficiency. The other is potential for interpretation.
In finite samples, plain RF can have a hard time learning smooth relationships -- like a AR(1) process. This is bad news for time series applications. For prediction purposes, estimating $$y_t = \phi y_{t-1} +\varepsilon_t$$ by OLS implies a single parameter. However, approximating the same relationship with a tree (or an ensemble of them) is far more consuming in terms of degrees of freedom. To get close to the straight line once parsimoniously parametrized by $\phi$, we now need a succession of many step functions.\footnote{In a standard regression setup, nobody would model a continuous variable as an ordinal one unless some wild nonlinearities are suspected.} With short time series, modeling smooth/linear relationships in such a way is a luxury one rarely can afford. The mechanical consequence is that RF will waste many splits on capturing the linear part, and may run out of them before it gets to focus more subtle nonlinear phenomena.\footnote{One necessary (but not sufficient) symptom is AR terms being flagged as really important by typical RF variable importance measures (one example is borup2020now).} In a language more familiar to economists, this is simply running out (quickly) of degrees of freedom. MRF provides a workaround. Modeling the linear part concisely leaves more room to estimate the nonlinear one. By its more strategic budgeting of degrees of freedom, the resulting (estimated) partially linear model could be, in fact, more non-linear than the fully nonparametric one.
This paper is not the first to recognize the potential need for a linear part in tree-based models. For instance, both treed and modeltrees proposed linear regressions within a leaf of a tree, respectively denominated "Treed Regression" and "Model Trees". More focused on real activity forecasting, woloszko2020adaptive and wochner2020dynamic blend insights from macroeconomics to build better-performing tree-based models.\footnote{Specifically, wochner2020dynamic also note that using trees in conjunction with factor models can improve GDP forecasting. An analogous finding will be reported in section (ref).} On a different end of the econometrics spectrum, friedberg2019llf proposed to improve the nonparametric estimation of treatment effect heterogeneity by combining those ideas developed for trees into a forest.\footnote{More broadly, this is extending to trees and ensemble of trees the "classical" non-parametrics literature's knowledge that local linear regression usually has much better properties (especially at the sample boundaries) than the Naradaya-Watson estimator.} To my knowledge, this paper is the first to exploit the link between this strand of work and the sempiternal search for the "true" state-dependence in empirical macroeconomic models.
The interpretation of ML outputs is now a field of its own molnar2019interpretable. RF is widely regarded as a black box model which needs to be interpreted using an external device. Indeed, it usually averages over 100 trees of substantial depth, which makes individual inspection impossible. MRFs partially circumvent the problem by providing time series $\beta_t$ which can be examined, and have a meaning as time-varying parameters for the linear model. Thus, whatever one may do with TVPs, it can be done with GTVPs. There are also some new avenues. For instance, Variable Importance (VI) measures usually deployed to dissect RF's prediction can be used to inspect what is driving $\beta_t$'s. Those will be used in section (ref).
A popular approach to dissect a standard RF is to use interpretable surrogate tree models to partially replicate the black box model's fit. The idea can be transferred to MRF molnar2019interpretable. In fact, partial linearity facilitates such an exercise. The linear part in MRF splits the nonparametric atom into different pieces ($X_{t,k}\beta_{t,k}$) which can be analyzed separately. Each time series $\beta_{t,k}$ can be dissected with its own surrogate model, and meaningful combination/transformations of coefficients can be considered.
This section discusses principles guiding the composition of $S_t$, which is the raw material for $\mathcal{F}$ in both MRF and plain RF. Macroeconomic data sets \citetext{e.g. FRED, mccracken2020fred} typically contains many regressors and few observations. After incorporating lags for each variable, it can easily be the case that predictors outnumber observations. The curse of dimensionality has both computational and statistical ramifications. The former is mostly avoided in RF since it does not rely on inverting a matrix. However, the statistical curse of dimensionality, a feature of the regressors/observations ratio, remains a difficulty to overcome.
There are two extreme ways of reducing dimensionality: sparse or dense. The former selects a small number of features out of the large pool in a supervised way (e.g. LASSO), the latter compresses the data in a set of latent factors that should span most of the original regressors space. This is often seen as a necessity to choose one of them.\footnote{In macro forecasting work using RF, GCLSS2018 follow a dense approach by only including factors while borup2020targeting opt for sparsity by proposing a Lasso pre-selection step.} However, in a regularized model, both can be included, and we can let the algorithm select an optimal combination of original features and factors.\footnote{A more detailed discussion of this can be found in Appendix (ref).} This is useful --- it is not hard to imagine a situation where opting for one or the other would prove suboptimal to a more nuanced solution.
{\sc Lag Polynomials.} From a predictive standpoint, residuals autocorrelation implies there is forecasting power left on the table. To get rid of it, many lags might be necessary. In multivariate contexts (like that of a VAR), doing so quickly pushes the model to overfit. A standard solution is Bayesian estimation and the use of priors in the line of litterman1984, which are specially designed for blocks of lags structures. Outside of the VAR paradigm, there is an older literature estimating restricted/regularized lag polynomials in Autoregressive Distributed Lags (ARDL) models almon,shiller1973. More recently, these methods have found new applications in mixed-frequency models ghysels2007midas where the design of the model leads to an explosion of lag parameters.
(M)RF experiences an analogous situation. A tree may waste many splits trying to efficiently extract information out of a lag polynomial: for instance, splitting on the first lag, then the 7th one, then the 3rd one. In linear parametric models, the above methods can extract the relevant information out of a lag polynomial without sacrificing many degrees of freedom. A significant roadblock to this enterprise in the RF paradigm is that there are no explicit lag polynomials to penalize. An alternative route is to exploit the insight that RF can choose for itself relevant restrictions. We just have to construct regressors that embodies those, and include them in $S_t$.
\vskip 0.2cm
{\sc Moving Average Factors.} To extract the essential information out of the lag polynomial of a specific variable, a linear transformation can do the job. Consider forming a panel of $P$ lags of variable $j$: $$X_{t,j}^{1:P}\equiv [X_{t-1,j} \enskip ... \enskip X_{t-P,j}] \enskip.$$ We want to form weighted averages of the $P$ lags so that it summarizes most efficiently the temporal information of the feature indexed by $j$.\footnote{$P$ is a tuning parameter the same way the set of included variables in a standard factor model is one.} The weighted averages with that property will be the first few factors (extracted by PCA) of $X_{t,j}^{1:P}$.\footnote{While I work directly with the latent factors, a related decomposition called singular spectrum analysis works with the estimate of the summed common components. Since this decomposition naturally yields a recursive formula, it has been used to forecast macroeconomic and financial variables hassani2009forecasting, hassani2013predicting.} This can be seen as the time-dimension analog to the traditional cross-sectional factors. The latter are defined such as to maximize their capacity to replicate the cross-sectional distribution of $X_{t,j}$ fixing $t$ while the Moving Average Factors (MAFs) proposed here seek to represent the temporal distribution of $X_{t,j}$ for a fixed $j$ in a lower-dimensional space.\footnote{In the spirit of the Minnesota prior, one can assign decaying (in $p$) weights to each lag before running PCA. This has the analogous effect of shrinking more heavily the distant lags and less so the recent ones.} By doing so, our goal to summarize the information of $X_{t,j}^{1:P}$ without modifying the RF algorithm (or any other) is achieved: rather than using the numerous lags as regressors, we can use the MAFs which compress information ex-ante. As it is the case for standard factors, MAF are designed to maximize the explained variance in $X_{t,j}^{1:P}$, not the fit of the final target. It is the RF part's job to select the relevant linear combinations among $S_t$ so to maximize the fit. Finally, it is noteworthy that MAFs facilitate interpretation. As these are moderately sophisticated averages of a single time series, they can be viewed as a smooth index for a specific (but tangible) economic indicator. This is arguably much easier to interpret than a plethora of lags coefficients.
The take-away message from this subsection can be summarized in three points. First, there is no need to choose ex-ante between sparse and dense when the model performs selection/regularization. We can let the algorithm find the optimal balance. Second, to make the inclusion of many lags useful, we need to regularize the lag polynomial. Third, such compression can be achieved most easily by generating MAFs and using those as regressors in RF -- or any algorithm.
taddy2015bayesian and taddy2016nonparametric interpret RF's prediction as the posterior mean of a tree functional $\mathcal{T}$ (the splitting algorithm) obtained by an approximate Bayesian bootstrap.\footnote{The connection between breiman1996bagging's bagging and rubin1981bayesian's Bayesian Bootstrap was acknowledged earlier in clyde2001bagging.} Through those lenses, each tree is a posterior draw. Seeing $\mathcal{T}$ as a Bayesian nonparametric statistic (independently of the DGP) is of even greater interest in the case of MRF.\footnote{An alternative (frequentist) inferential approach is that of friedberg2019llf. However, their asymptotic argument requires estimating the linear coefficients and the kernel weights on two different subsamples. This is hard to reconciliate with our goal of modeling time-variation and different regimes throughout the entire sample. Furthermore, when the sample size is small, splitting the sample in such a way carries binding limitations on the complexity of the estimated function.} It provides inference for meaningful time-varying parameters $\beta_t$ rather than an opaque conditional mean function. Such techniques, originating from ferguson1973bayesian, have seldomly found applications in econometrics, such as chamberlain2003nonparametric for instrumental variable and quantile regressions.
While the Bayesian Bootstrap desirably does not assume many things about the data, it yet makes the assumption that $Z_t = [y_t \enskip X_t \enskip S_t]$ is an iid random variable. Thus, it cannot be used directly as a proper theoretical motivation for using the bag of trees directly to conduct inference. I propose a block extension to make taddy2015bayesian's convenient approach amenable to this paper's setup.
Block Bayesian Bootstrap (BBB) is a simple redefinition of $Z$ so that it is plausibly iid. Hence, in the spirit of traditional frequentist block bootstrap mackinnon2006bootstrap, blocks of a well-chosen size will be exchangeable. Thus, a new variable can be defined $Z_\mathfrak{b} \equiv [y_{\underline{\mathfrak{b}}:\bar{\mathfrak{b}}} \enskip X_{\underline{\mathfrak{b}}:\bar{\mathfrak{b}}} \enskip S_{\underline{\mathfrak{b}}:\bar{\mathfrak{b}}}]$. There will be a total of $\mathfrak{B}=\sfrac{T}{\text{block size}}$ fixed and non-overlapping blocks. Under covariance stationarity, $\tilde{Z}_\mathfrak{b} = vec(Z_\mathfrak{b})$ are iid, for a properly chosen block length.\footnote{In practice, I will use block of two years for both quarterly or monthly data.} Analogously to taddy2015bayesian, block-subsampling is preferred to BBB in implementations since it is faster and gives nearly identical results. Details of BB and BBB are available in Appendix (ref).
It is reasonable to wonder how the above procedure deals with the possible presence of heteroscedasticity. Fortunately, the nonparametric bootstrap/subsampling that RF uses is in fact the "pairs" bootstrap of pairsbootstrap which is valid under general forms of heteroscedasticity mackinnon2006bootstrap. From a Bayesian point of view, lancaster2003 show that the obtained variance for OLS from using such a bootstrap is asymptotically equivalent to that of White's sandwich formula.\footnote{poirier2011bayesian propose better priors and karabatsos2016dirichlet incorporate such ideas into a generalized ridge regression.} Hence, in the spirit of heteroscedasticity-robust estimation, no attempt will be made at directly evolving volatility (which is a GLS approach). Rather, it will be reflected in larger bands for periods of smaller signal-to-noise ratio.
Simulations are divided in two parts. The first shows that Autoregressive Random Forest (ARRF) delivers forecasting gains over standard nonlinear time series model when the true DGP mixes both endogenous and exogenous time-variation. Moreover, the former is very resiliant against traditional approaches, even when the DGP matches the latter's restrictive assumptions. Additionally, those simulations will numerically document the superiority of ARRF over RF when the AR part is pervasive (as discussed in section (ref)). Overall, this helps rationalizing forecasting results from section (ref), where ARRF supplants $\sim$TARs for the vast majority of targets.
The second simulations section considers simpler linear parts and look at how the algorithm behaves when $S_t$ is large. Further, I focus on $\beta_t$ itself and its credible regions. The main point is to visually show that (i) GTVPs adapts nicely to a wide range of DGPs and (ii) are not prone to discover inexistent time-variation.
I consider 3 DGPs: Autoregression (AR), Self-Exciting Threshold ARs (SETAR), and a SETAR model that collapse to an AR (via a structural break). Those DGPs include two types of time variations, endogenous ($y_{t-1}$) and exogenous ($t$).\footnote{Since a structural break is just a threshold effect with respect to variable $t$, one can conclude without loss of generality that similar results would be obtained using different additional switching variables.} They are meant to encapsulate compactly the usual nonlinearities considered in empirical studies, like dependence on the state of the business cycle AG2012,rameyzubairy2018 and exogenous time variation clarida2000.
For all DGPs, $X_{t}=[1 \enskip {y_{t-1}} \enskip {y_{t-2}}]$. The simulated series sample size is either $T=150$ or $T=300$. The last 40 observations of each sample consist the hold-out sample for evaluation. I forecast 4 different horizons: $h=1,2,3, 4$. Models are estimated once at the last available data point.
{\sc Models.} SETAR, Rolling-Window (RW) AR, Random Forest (RF) and Autoregressive Random Forest (ARRF) are included. Iterated SETAR forecasts are obtained via the standard bootstrap method clements1997setar and all the others are generated via direct forecasting. That is, in the latter case, I fit the model directly on $y_{t+h}$ rather than iterating forward the one-step ahead forecast. To certify that the observed differences between SETAR and other models is not merely due to the choice of iterated vs direct forecasts -- a non-trivial choice in many environments chevillon2007direct --, I also include SETAR-d where "d" means its forecasts were alternatively obtained by direct forecasting.
In all simulations, MRF's $S_{t}$ includes 8 lags of $y_t$ and a time trend, which match what will be referred to in section (ref) as "Tiny ARRF". Thus, unlike $\sim$TARs, it is "allowed" to split on what we know (by the DGP choices) to be useless regressors (especially at horizon $h=1$). The specified linear part for all models matches that of the true DGP ($X_{t}=[1 \enskip {y_{t-1}} \enskip {y_{t-2}}]$).
{\sc Performance Metric.} Performance is evaluated using the mean squared prediction error (MSPE). In simulation $s$, for the forecasted value at time $t$ made $h$ steps ahead, I compute $$RMSE_{h,m}= \sqrt{ \frac{1}{40 \times 100}\sum_{s=1}^{100} \sum_{t \in \text{OOS}} (y_{t}^s-\hat{y}_{t-h}^{s,h,m})^2}.$$ 100 different simulations are considered, which means the total number of squared errors being averaged for a given horizon and model is 100$\times$40=4000. To provide a visually useful normalization, bar plots report $RMSE_{h,m}$'s relative to that of the oracle, who knows perfectly the law of motion of time-varying parameters $\beta_t$.\footnote{Precisely, if the model has a break and a switching variable, it knows exactly the break points, thresholds and AR parameter values in each regime. The only things the oracle does not know are the future shocks ($\epsilon_{t+h}$), and the out-of-sample evolution of parameters ($\beta_{t+h}$) -- unless the latter is purely deterministic.} Formally, the metric is $\Delta_o {RMSE}_{h,m}=\sfrac{{RMSE}_{h,m}}{{RMSE}_{h,o}} -1.$
\vskip 0.2cm {\sc SETAR Morphing Instantly into AR(2).} The two sources of time-variation are combined to display MRF's edge in this not so implausible situation. Further,
can rightfully be hypothesized for some economic time series: complex dynamics up until the mid-1980's followed by a very simple autoregressive structure during the Great Moderation.\footnote{The AR has ${\beta}= [0 \enskip 0.7 \enskip -0.2]$ and the SETAR has $\beta_{t}=I(y_{t-1}\geq 1)[2 \enskip 0.8 \enskip -0.2] + I(y_{t-1}<1)[0.25 \enskip 0.4 \enskip -0.2]$. Results for the latter in isolation are in Appendix (ref).} In Figure (ref), MRF comes out as the best model for all horizons in the smaller sample. RF fails particularly at short horizons because it attempts to model all dynamics nonparametrically. Doubling the sample size helps, but its disimprovement with respect to the oracle remains at least twice as large as that of MRF. SETAR and AR both focus on dynamics but are misspecified. Their increase in relative RMSE is about thrice that of MRF at longer horizons for the shorter sample. For horizon 1, RW-AR does equally well as MRF, which is expected in this DGP since it discards earlier observations we only know ex-post to be harmful. Thus, in this DGP much akin to that of the hypothetical inflation tree of section (ref), MRF comes out as the clear winner.
\vskip 0.2cm {\sc Persistent SETAR.} DGP 2, with $\beta_{t}=I(y_{t-1}\geq 0)[2 \enskip 0.8 \enskip -0.2] + I(y_{t-1}<0)[0.25 \enskip 1.1 \enskip -0.4]$, represents an endogenous switching process which may suit well real activity variables: it includes high/low regimes, and mildly different dynamics in each of them. Can MRF match traditional nonlinear times series model when the world is nonlinear, yet simple? The broad answer from Figure (ref) is yes. For all horizons and sample sizes considered, MRF is practically as good as SETAR, the optimal model in this context. Because of its capacity to control overfitting, MRF will be competitive even if nonlinearities turn out to be as simple as often postulated in the empirical macroeconomics literature. With the relative importance of changing persistence, RF cannot match MRF's performance and is trailing behind with RW-AR.\footnote{In Appendix (ref), the case where the changing persistence is less important is considered.} Nevertheless, RF improves substantially at shorter horizons when the sample size increase. Finally, AR is resilient at longer horizons but is much worse than MRF and SETAR at shorter ones.
\vskip 0.2cm { \sc No Time-Variation.} Given the widespread worry that ML-based algorithms can overfit, a time-invariant DGP is a natural check.\footnote{Also, the incredible resilience of linear AR models is well documented in the macroeconomic forecasting literature (see KLS2019 and references therein).} Can MRF still deliver competitive performance if reality equates simple linear dynamics? Results for DGP 3, an AR(2) process with ${\beta}= [0 \enskip 0.7 \enskip -0.2]$, are reported in Figure (ref). As expected, AR is the best model for all horizons and both sample sizes. The RW-AR suffers from high variance and it is assumed that tuning the window length in a data-driven way would help. Plain RF struggles irrespective of the sample size. For the smaller sample, MRF performs as well as the tightly parametrized SETARs. Their marginal increases in RMSE with respect to the oracle are typically less than 10%, which is small in contrast to that of previous DGPs. More observations generally helps AR, the iterated SETAR, and MRF especially at longer horizons.
\vskip 0.2cm {\sc About Misspecification of $X_t$.} Most of the reported gains from using MRF come from avoiding misspecification when a more complex DGP arises. What happens if the arbitrary linear part in MRF, $X_t$, is itself misspecified? Figure (ref) in the appendix report corresponding results. For all DGPs under consideration, a "Bad" MRF, where $X_t$ is composed of two white noise series (instead of the first two lags of $y_t$), performs similarly well (or bad) as plain RF.\footnote{This result may not hold, however, when the law of motion for the intercept is highly complex and requires a great number of split (unlike what is considered here). This is due to the linear part restricting the depth of trees (with to what plain RF could allow for), especially if observations are scarce. In that regard, increasing the ridge penalty (via $\lambda$) will help. Nevertheless, in practice, it is a safer bet to use a small linear part if uncertainty around its composition is high. More on this and the effect of hyperparameters can found in appendix (ref).}
\vskip 0.2cm
{\sc Summary.} First, when the true DGP is not that of the tightly parametrized classical nonlinear time series model, the more flexible MRF does better. Second, when classical nonlinear time series model are fitted on their corresponding DGPs, those perform better than MRF -- but only marginally. Third, when there are pervasive linear autoregressive relationships, plain RF struggles. Fourth, MRF and RF relative performance both increase with the number of observations but MRF's one increases faster if the linear part is well-chosen. In Appendix (ref), results for 3 additional DGPs are reported: another SETAR, AR with a structural break, and SETAR morphing in another SETAR (through a break). Again, MRF is shown to have an edge when other models are misspecified and almost as good when those are not.
A notable difference between the simulations presented up to now and the applied work being carried in later sections is the size of $S_t$. In many macro applications, there is no shortage of variables to include in MRF's $\mathcal{F}$. For instance, the FRED-QD data base mccracken2020fred contains over 200 potential predictors that can join lags of $y$ and a time trend within $S_t$. As a result, there is now considerable interest in allowing for time variation in empirical models using large information sets. For instance, koop2013large propose large TVP-VARs while abbate2016changing extend bernanke2005measuring's factor-augmented VAR to be time-varying. Interestingly, those papers (and the corresponding literature) almost exclusively focus on a setup where, in MRF notation, $X_t$ is large and $S_t$ is extremely small (usually just $t$). Of course, MRF could deal with this case (as discussed in section (ref)), but its edge will be more apparent when we let the RF part deal with large data and keep $X_t$ concise. Indeed, in addition to lessened misspecification concerns, RFs also benefits from more data through increased randomization -- which prevents fully grown trees from overfitting breiman2001,MSoRF.
The additional simulations go as follow. First, I simplify the analysis by looking at a static model with mutually orthogonal but autocorrelated regressors $X_1$ and $X_2$, both driving $y_t$ according to some process. I simulate each of them for 1000 periods and estimate the models with the first 400 observations. The remaining 600 are used to evaluate the out-of-sample performance. The signal to noise ratio is calibrated to $\sfrac{2}{3}$ which is about what is found (out-of-sample) for most models in the empirical section.
The only remaining questions are that of the constitution of $S_t$ and the generation of $\beta_t$'s. I create two autocorrelated (but not cross-correlated) factors. Out of each of them, I create 50 series with a varying amount of additional white noise.\footnote{To be precise, their standard deviation is $U[0.5,3]$% that of the original factor standard deviation.} Joining those 100 series with lags of $y_t$ and a time trend, the final size of $S_t$ is slightly above 100. Finally, $\beta_t$'s are functions of the underlying first factor which (like the second) is not directly included in the data set. In certain DGPs, some $\beta_t$'s will also be a pure function of $t$ (like random walks, structural breaks).\footnote{To clarify, the second factor and underlying series are completely useless to the true DGP -- arguably mimicking the inevitable when using a data base of the size of FRED-QD.} Table (ref) summarizes the six DGPs in words.
More illustratively, Figures (ref) and (ref) (appendix) plots one example of each DGPs as well as the estimated GTVPs and their credible region (as discussed in section (ref)). It is visually obvious that GTVPs are adaptive in the sense that it can discover which kind of time-variation is present in the data while estimating it. In Figure (ref), MRF successfully estimate the rather radical switching regimes present in all coefficients. In Figure (ref), MRF realizes that almost all of $S_t$ is useless because true $\beta_t$ follow random walks. Rather, it manages to fit $\beta_t$'s nicely by relying on a multitude of $t$ splits. In Figure (ref), things get "easier" for the true $\beta_{X_1,t}$ as it is driven directly by the first latent factor. MRF discovers that and leverage it to have a very tight fit for it, both in-sample and out-of-sample. This is merely a reflection that if time variation can be constructed by simple interaction terms, this is certainly the easiest statistical route to by -- and MRF chooses it thanks to its inherent ability to perform "time variation selection".
Figure (ref) reports distributions of RMSE differentials with respect the oracle (the forecast that knows the $\beta_t$'s law of motion). MRF performance is compared to OLS, Rolling-Window OLS (RW-OLS) and plain RF. As expected, MRF outperforms all alternatives by wide margins for most DGPs. By construction, RW-OLS and OLS also perform well for DGP 5 (random walks) and DGP 6 (constant parameters). Nonetheless, it is reassuring to see that MRF either performs much better than OLS or worse by a thin margin (in cases with no time-variation).
In this section, I present results for a pseudo-out-of-sample forecasting experiment at the quarterly frequency using the dataset FRED-QD mccracken2020fred. The latter is publicly available at the Federal Reserve of St-Louis's web site and contains 248 US macroeconomic and financial aggregates observed from 1960Q1. The forecasting targets are real GDP, Unemployment Rate (UR), CPI Inflation (INF), 1-Year Treasury Constant Maturity Rate (IR) and the difference between 10-year Treasury Constant Maturity rate and Federal funds rate (SPREAD). These series are representative macroeconomic indicators of the US economy which is based on GCLSS2018 exercise for many ML models, itself based on KLS2019 and a whole literature of extensive horse races in the spirit of SW1998comparison. The series transformations to induce stationarity for predictors are indicated in mccracken2020fred. For forecasting targets, GDP, UR, CPI and IR are considered $I(1)$ and are first-differenced. For the first two, the natural logarithm is applied before differencing. SPREAD is kept in "levels". Forecasting horizons are 1, 2, 4, 6 and 8 quarters.
The pseudo-out-of-sample period starts in 2003Q1 and ends 2014Q4. I use expanding window estimation from 1961Q3. Models are estimated (and tuned, when applicable) every two years. For all models except SETAR and STAR, I use direct forecasts, meaning that $\hat{y}_{t+h}$ is obtained by fitting the model directly to $y_{t+h}$ rather than iterating one-step ahead forecasts. $\sim$TAR iterated forecasts are calculated using the block-bootstrap method which is standard in the literature clements1997setar.
Following standard practice, the quality of point forecasts is evaluated using the root Mean Square Prediction Error (MSPE). For the out-of-sample (OOS) forecasted values at time $t$ of variable $v$ made $h$ steps ahead, I compute $$RMSE_{v,h,m}= \sqrt{ \frac{1}{\#\text{OOS}}\sum_{t \in \text{OOS}} (y_{t}^v-\hat{y}_{t-h}^{v,h,m})^2}.$$ The standard dieboldmariano (DM) test procedure is used to compare the predictive accuracy of each model against the reference AR(4) model. $RMSE$ is the most natural loss function given that all models are trained to minimize the squared loss in-sample.
It has been argued in section (ref) that feature engineering matters crucially when the number of regressors exceeds the sample size. $S_{t}$, the set of variables from which RF can select, is motivated by such concerns. Its exact composition is detailed in Table (ref). Among other things, it includes both cross-sectional and moving average factors, which are compressing information along their respective dimensions. The usefulness of MAFs is further studied in MDTM and found to help, mostly with tree-based algorithms. However, it is supplanted by a more computationally demanding (but more general) transformation of the raw data that MDTM propose specifically for ML-based macroeconomic forecasting.
{ \sc Models.} To better understand where the gains from MRF are coming from, I include models that use different subsets of ideas developed in earlier sections. Those are summarized in Table (ref). The competitive data-rich models are in the benchmarks group. Non-linear time series models are also included as they share an obvious familiarity with ARRF. "Tiny" versions of both ARRF and RF are considered to gauge the effect from only having access only to a small $S_t$ --- this could be the case for many non-US applications. Conversely, this helps quantify how a data-rich environment contributes to the success of ARRF versus its plain flexibility. Indeed, Tiny ARRF corresponds to what was shown in the "data-poor" simulations (section (ref)) to be a generalization of $\sim$TARs and related models.
Here are some remarks motivating some inclusions and specifications choices. To assess the marginal effects of MAFs alone, Lasso, Ridge and RF are considered using $S_t$ --- those are known to handle high-dimensional feature space. When it comes to FA-ARRF, I opt for a parsimonious linear specification including one lag of the first two factors. First, concise models make interpretation easier. Second, considering compact linear specifications within MRF is usually the better strategy. Parameters (including the intercept) are all RFs in their own right and can palliate to the omission of marginally important features, if need be. Consequently, it is desirable to fix a humble linear part and let $\beta_t$'s take care of the rest.\footnote{Further backing a parsimonious choice (with MRF), mccracken2020fred report that the first two factors account for 30% of the variation in the data while adding two more only bumps it up to 41%, making the last two presumably more disposable in our context.} Finally, as discussed in mccracken2020fred, the first factor mostly loads on real activity variables while the second is a composite of forward-looking indicators like term spreads, permits and inventories. They are baptized and interpreted accordingly.
Violin plots are used throughout to summarize dense RMSEs tables (like Table (ref)). I report the distribution of $RMSE_{v,h,m}/RMSE_{v,h, AR}$. This is informative about the overall ranking and versatility of considered models. Of course, being ranked first does not imply being the best model for every $h$ and $v$. Rather, it means that it performs better on average, over all targets.
Here are interesting observations from Figure (ref). Clearly, MRFs deliver important gains over both the AR and FA-AR benchmarks (the latter is second to last). ARRF has a noticeably small mass above the 1 line. In other words, there are no targets for which ARRF does significantly worse than its OLS counterpart, which makes it atypically adaptable among nonlinear autoregressions. A look at Table (ref) confirms this observation also extends to FA-ARRF vs FA-AR. The simplification AR+RF, ranks third with a performance that is much more volatile. This suggests that imposing time-invariant dynamics can sometimes help (see one example in Figure (ref)), but can also be highly detrimental (as reported for inflation). Of course, that we do not know ex-ante, and it is why AR+RF does not inherit ARRF's "off-the-shelf" quality.
MAFs are useful: RF-MAF does much better than RF which uses the raw data. The latter only exhibits conservative gains over the benchmark. Thus, it is understood that a fraction of MRFs' forecasting gains emanates from considering more sensible transformations of time series data -- and which are trivially implementable. The relevance of MAFs is studied more systematically in MDTM.
FA-ARRF provides very substantial improvements, but can also fail. This is the linear part's doing: FA-AR will mostly work well for real activity variables while AR is a jack of all trades. Thus, it is not surprising to see FA-ARRF inherit some of these uneven properties, albeit to a much milder extent. For instance, in Table (ref), FA-AR is noticeably worse than AR for all inflation horizons, while FA-ARRF beats AR for all of them. This phenomenon is well summarized by FA-AR being second to last overall, well behind FA-ARRF. VARRF has a behavior similar to that of FA-ARRF, but with less highly noticeable gains.
Does a large $S_t$ pay off? Most of the time, yes. It is worth re-emphasizing that restricting $S_t$ restricts the space of time-variations possibilities as well as the potential for trees diversification. Nonetheless, if the restrictions are "true", gains are possible.\footnote{An interesting specific case is Tiny ARRF being close behind ARRF for inflation. This is intuitive given that INF has often been associated with exogenous time variation.} This is reported to be a rare occurrence, with ARRF $\succ$ Tiny ARRF (and RF $\succ$ Tiny RF) for almost any target. Thus, we can safely conclude that a rich $S_t$ is desirable, with $\mathcal{F}$ being tasked with selection of relevant items.
As discussed in earlier sections, ARRF connects to the wider family of nonlinear autoregressive models. It clearly does better on average than SETAR and Smooth-Transition TAR. This advantage is attributable to both a more flexible law of motion and a large $S_t$. Tiny ARRF is better than the $\sim$TAR group, while ARRF is much better. Linking this result to those of simulations, this means that no $\sim$TAR is likely the true model.
{\sc Real Activity Targets.} Figure (ref) reports results for UR. FA-ARRF dominates strongly. Table (ref) confirms it is the best model for all horizons but the last one (8 quarters ahead, where the encompassed RF-MAF is the best). Clearly, at an horizon of one quarter, the preferred model successfully predicts the drastic rise in unemployment during the Great Recession. Rather than responding with a lag to negative shocks (which is what we observe from AR and ARRF), the model visibly predicts them. As a result, improvements in RMSE are between 25% and 30% over AR for all horizons. Specifically, predicting UR (change) with FA-ARRF at $h=1$ yields an unusually high out-of-sample $R^2$ of about 80%. The nearly perfect overlap of the yellow and black lines highlight the absence of a one-step ahead shock around 2008. Note that FA-AR and STAR forecasts are omitted from Figure (ref) to enhance visibility. STAR forecasts are either similar or worse than the benchmark (as often found for nonlinear time series models). FA-AR forecasts at $h=1$ follows a proactive pattern similar to the yellow line, but with a 1 to 2 quarter delay -- hence the inferior results.
For $h=2$, the quantitative rise is nowhere near the realized one, but it reveals 6 months ahead the arrival of a significant economic downturn. Additionally, ARRF and FA-ARRF both flag one year ahead the arrival of a rise in unemployment, which is a quality shared by very few models. The barplot in Figure (ref) (and Table (ref)) provides a natural decomposition of FA-ARRF's gains. Adding the MAFs to an otherwise plain RF procures an improvement of roughly 15% across all horizons (RF-MAF $\succ$ RF, in Table (ref)). The linear FA-AR part and the rest of algorithmic modifications discussed in section (ref) provide an additional reduction of 10% to 15% depending on the forecasted horizon (FA-ARRF $\succ$ RF-MAF and FA-ARRF $\succ$ FA-AR). It is noteworthy that good results for $h=1$ are mechanically close to impossible with a plain RF since it cannot extrapolate -- i.e., predict values of $y_t$ that did not occur in-sample. In contrast, this is absolutely feasible within MRF thanks to the linear part.
GDP is known to have a lower signal-to-noise ratio. In Figure (ref), FA-ARRF exhibits a bit less than a 20% drop in RMSE over the AR and nicely grasp the 2008 drop one quarter ahead.\footnote{diebold1994measuring proposed an empirically sucessful regime-switching factor model. Given that line of work and more recent results in wochner2020dynamic, the FA-ARRF's success is not an anomaly.} However, FA-ARRF performance does not stand apart as much as it did for UR. One reason can be traced visually to predicting higher post-recession growth than its competitors. Finally, RF-MAF closing in on ARRF will be investigated on its own in section (ref). In short, this occurs because once the time-varying intercept is flexibly modeled by RF, there is very little room left for autoregressive behavior (at the quarterly frequency).
{\sc Spread and Inflation.} VARRF shines for SPREAD (Figure (ref)) by capturing key movements, even up to a year ahead. The simpler AR+RF also does remarkably well. FA-ARRF provides successful one-year ahead forecasts. Overall, these results highlight the common importance of the autoregressive part, which is no surprise given SPREAD's persistence. For INF, Table (ref) displays that RF-MAF is the leading model (with ARRF close behind) reducing RMSEs by 12-15% for all horizons. I investigate this with GTVPs in section (ref).
Based on forecasting results, I concentrate on FA-ARRF's GTVPs. Additionally, its parameters are easier to interpret (given factors are labeled) since regressors are mechanically orthogonal. First, I look at $\beta_t$ and analyze their behavior around the Great Recession. Second, I compare GTVPs to random walk TVPs, ex-post vs ex-ante, with a focus on the recessionary episode. Finally, I use a surrogate model approach to explain of the parameters' paths in terms of observed variables.
$\beta_t$'s characterize completely MRF's forecasts. Thus, we can investigate GTVPs to understand results from the previous section. The FA-ARRF forecasting equation is $$ y_{t+h}=\mu_t + \phi_{1,t}y_{t}+\phi_{2,t}y_{t-1}+\gamma_{1,t} F_{1,t}+\gamma_{2,t} F_{2,t}+u_{t+h}.$$ and naturally $\beta_t = \left[\mu_t \enskip \phi_{1,t} \enskip \phi_{2,t} \enskip \gamma_{1,t} \enskip \gamma_{2,t}\right]$. To avoid overfitting, $\hat{\beta}_t$'s are (as in section (ref)) the mean over draws that did not include observations $t-4$ to $t+4$ (a two-year block) in the tree-fitting process. Intuitively, this mimics in-sample the real out-of-sample experiment that starts here in 2007Q2.\footnote{Note that this is partially different from what gave the results reported in section (ref), where the model was re-estimated every 2 years. Here, estimation occurs once in 2007Q2.}
Figure (ref) displays GTVPs underlying the successful one-step ahead UR change forecast. The intercept clearly alternates between at least two regimes and the "increasing UR" one is in effect circa 2008. In levels, this translates to UR alternating between a positive and negative (albeit small) trend. Overall persistence is strikingly time-invariant, and marginally smaller than for OLS estimates. The effect of $F_1$, the real activity factor, is generally within OLS confidence intervals, suggesting that while $\gamma_{1,t}$ almost doubles around recessions, this is subject to great uncertainty.
What is less uncertain, however, is the magnified contribution of the forward-looking factor $F_2$ during recessionary episodes, which stands out as the key difference with OLS. $\gamma_{2,t}$ smooth-switching behavior can be best interpreted by remembering that $F_2$ is highly correlated with capacity utilization, manufacturing sector indicators, building permits and financial indicators (like spreads) mccracken2020fred. Many of those variables are considered "leading" indicators and have often been found to increase forecasting performance, mostly before and during recession periods stock1989new, estrella1998predicting,leamer2007housing. Recently, there has been renewed attention on the matter, with financial indicators highlighted as capable of capturing economic activity downside risk adrian2019,delle2020modeling. This brand of nonlinearity can translate to a more active $\gamma_{2,t}$ around business cycle turning points. MRF learns that, while OLS provides a clumsy average of two regimes. In Figure (ref), the obvious consequence of OLS' rigidity is being over-responsive to leading indicators during tranquil economic times, and under-responsive when it matters.
Section (ref) will investigate formally the underlying variables driving this time variation. Figure (ref) displays equivalent $\beta_t$ for GDP one quarter ahead. The pattern $\gamma_{2,t}$ is also visible for GDP, but it is quantitatively weaker and more uncertain -- which is is no surprise given GDP being generally noisier than UR. Additionally, slow and relatively mild long-run change is observed. Interestingly, $\gamma_{1,t}$ has been shrinking since the mid 1980s, and its regime dependence exhibited in the first four recessions is no more.
The relationship between random walk TVPs and GTVPs was evoked earlier. I compare them for the small factor model. I estimate standard TVPs using the ridge regression technique developed GC2019. Conveniently, the procedure incorporates a cross-validation step that determines the optimal level of time variation in the random walks.\footnote{I show with simulations that this much easier approach performs similarly well (and sometimes better) to traditional Bayesian TVP-VAR, for model sizes that the latter is able to estimate.}
As Figure (ref) suggested for $\mu_t$ and $\gamma_{2,t}$, parameters can be subject to recurrent, rapid and statistically meaningful shifts. Such behavior creates difficulties for random-walk TVPs, which put the accent on smooth and slow structural change. Figure (ref) confirms this conjecture. Standard TVPs look for long-run change when regime-switching behavior is the main driving force. As a result, they are flat and within OLS confidence bands, as often reported in the literature AAG2013. Of course, more action will mechanically be obtained for TVPs when considering a smaller amount of smoothness than what cross-validation proposed. In appendix (ref), I report the same figures, but using the optimal smoothing parameters (as picked by CV) divided by 1000. This provides much more volatile random walk TVPs that are inclined, at certain specific moments, to follow the GTVPs. However, it is clear in Figure (ref) that the end-of-sample/revision problem is worsen by the forced lack of smoothing.
It is known in the traditional TVP literature that there is a balance between flexible (but often erratic) $\beta_t$ paths and very smooth ones where time variation may simply vanish.\footnote{In the case of ridge regression-based TVPs, cross-validation is just a data-driven way of backing this necessary empirical choice.} Since random-walk TVPs are unfit for many forms of the time-variation present in macroeconomic data, high bias estimates are usually reported as only them can keep variance at a manageable level. This can have serious implications. Relying too much on time-smoothing can create a mirage of long-run change and/or dissimulate parameters that mostly (but not solely) vary according to expansions/recessions.
Another concern, particularly consequential for forecasting, is the boundary problem. As discussed earlier, random-walk TVP models forecasts can suffer greatly from it because by construction, forecasts are always made at the boundary of the variable on which the kernel is based -- i.e., time. One can deploy a 1-sided kernel, but this only alleviate a few pressing symptoms without attacking the heart of the problem. In sharp contrast, GTVPs use a large information set $S_t$ to create the kernel, which implies that the likelihood of making a forecast at the boundary is rather low, unless the RF part constantly selects $t$ as splitting variable.
Figures (ref) and (ref) show, for both random walk and generalized TVPs, their full-sample versions (up to the end of 2014, "ex post") and their version with a training sample ending in 2007Q2 (the dashed blue line). There are two main observations. First, GTVPs are much less prompt to rewrite recent history than random-walk TVPs. Indeed, the green line and the magenta one closely follows each other all the way up to the end of the training sample. Second, while GTVPs can change many quarters after 2007Q2 (like the GDP constant), they are generally very close to each other at the boundary -- especially when the time variation is statistically meaningful (like that of $\mu_t$ and $\gamma_{F_2,t}$), which is what matters for forecasting. This is much less true of random walk TVPs as there are clear examples where the two version differ for a long period of time (for instance, the intercept and the coefficient on $F_2$ in the GDP equation), and this often culminates at the boundary.\footnote{In (real) practice, all models would be re-estimated each quarter. However, it is worth pointing out that re-estimating every period is much more important for random-walk TVP than it is for GTVPs. For such reasons, the TV-AR in section (ref) was the sole model estimated every period rather than every two years.}
MRF can sometimes be outperformed by simpler alternatives, like standard RF that incorporate MAFs. When that occurs, it is usually due to the inadequacy of the linear part rather than GTVPs themselves. Unlike traditional TVPs, GTVPs rarely provides a model worse than OLS.
Trivially, $\beta_t$ helps understanding relative performance. For instance, in the case of forecasting inflation with the quarterly data set, ARRF does not supplant RF-MAF. The critical difference between ARRF (reported in Figure (ref)) and its restricted analog is that the two autoregressive coefficients of the former are shut to 0.\footnote{Of course, lags of INF can still enter the forest part for $\mu_t$, so RF-MAF does not suppress entirely the link between current and recent inflation.} In Figure (ref), the estimates of ARRF broadly agree with the view that inflation persistence has substantially decreased during and following Volker disinflation cogley2001evolving,cogley2010inflation.
In terms of anticipated forecasting performance, such decline in persistence suggests a constrained version simply including $\mu_t$ may do better. The OOS evaluation period corresponds to the region of Figure (ref) where $\phi_{1,t}+\phi_{2,t}$ is the nearest to 0. Given that observation, RF-MAF mildly improving upon ARRF is less surprising. An analogous finding emerges for GDP at many horizons. ARRF does not outperform RF-MAF like FA-ARRF and larger VARs versions of MRF do. GTVPs showcased in Figure (ref) provide a simple explanation. There is only a limited role for persistence when allowing for a forest-driven $\mu_t$. $\phi_{1,t}+\phi_{2,t}$ is below the OLS counterpart most of the time and the credible 68% credible region frequently includes 0. The ensuing forecast is essentially a time-varying constant, which is what RF-MAF does.\footnote{This result is largely in accord with the reported sufficiency of a switching intercept (without additional autoregressive dynamics) to model US GDP in camacho2007jump. However, Figure (ref) suggests that there are rather 3 regimes: recession, expansion before 1985 (growth rate $\approx$ 3.5%), expansion after 1985 (growth rate slightly below 3%). The sufficiency of the switching intercept has also been documented in Markov-switching dynamic factor models for Norway aastveit2016identification and Germany carstensen2020predicting.} In sum, unlike many ML offerings, MRF successes and failures can be understood via a time-varying parameter interpretation. The helpfulness of this attribute cannot be overstated when thinking about future model improvements.
Evolving $\beta_t$ can limit macroeconomists in their ability to use the model for counterfactuals. Complementarily, policy-makers will complain about the limited use for a model in which tomorrow's parameters are unknown (random walks). Fortunately, GTVPs may be the result of an opaque ensemble of trees, but they are made out of observables rather than a multiplicity of latent states. That is, they change, but according to a fixed structure. Hence, the reduced-form coefficients could easily change, and yet remain completely predetermined as long as $\mathcal{F}$ itself is stable. In this paradigm, a changing $\beta_t$ is not necessarily empirical evidence supporting lucascritique's critique -- rather, a changing $\mathcal{F}$ could be. Hence, dissecting $\mathcal{F}$ is inherently interesting. One way to get started on this is to use well-established measures of Variable Importance (VI), originally proposed in breiman2001. Those extract features driving the prediction. Conveniently, they can be adapted to inquire $\beta_t$. Then, one can capitalize on VI's insights to build interpretable small trees parsimoniously approximating $\beta_{t,k}$'s path.
The construction of upcoming graphs consists in two steps. I start by computing 3 different VI measures: $VI_{OOB}$ (out-of-bag predictive performance), $VI_{OOS}$ (out-of-sample predictive performance) or $VI_{\beta}$ (for a specific coefficient rather than the whole prediction). Appendix (ref) contains a detailed explanation those and a discussion on how the current approach relates to recent work in the ML interpretability literature. As a potential data set for the construction of a surrogate tree, I consider the union of the 20 most potent predictors as highlighted by any of the three VIs. The tree is pruned with a cost-complexity factor (usually referred to as cp) of 0.075. That tuning parameter is set such as to balance its capacity to mimic the original GTVP and potential for interpretation.
I limit the attention $\mu_t$ and $\gamma_{2,t}$ paths, which were argued of greater importance to FA-ARRF's success in forecasting UR. Also, the nature of their variation is easier to characterize with a single tree (ex-post). Figures (ref) and (ref) show that paths can sometimes be summarized succinctly using a handful of predictors.
Most of $\mu_t$ can be captured by two states which are determined by a cut-off on total private sector employees (USPRIV): 0.021 (increasing unemployment) and -0.018 (decreasing). This first layer basically classifies recession vs expansions in a very parsimonious way, which is inevitably crude and imperfect. The additional split on a MAF of non-financial leverage provides a more refined classification: there are more of less three states. The time series plot shows the alternation between two symmetrically opposed states of 0.021 and -0.025 (respectively entering and exiting a recession) and a transitory (and seldomly visited) middle ground around 0.
The impact of $F_2$ on UR switches significantly, and most of the action can be summarized by a private sector employees dummy (USPRIV). The indicator's movement downwards -- which usually commence from the onset of a recession -- can double the effect of $F_2$ on UR in absolute terms. However, some high (absolute) $\gamma_{2,t}$ episodes would be left behind when merely using USPRIV. Those are retrieved by an additional split with a MAF of average corporate bonds yield with a BAA rating (lower medium grade).
The GTVP (green line) often plunges earlier than the ex-post surrogate tree's replica (orange). This is important, especially from a forecasting perspective. In Figure (ref), it is clear that leading indicators (especially financial ones) play a prominent role in driving the GTVP $\gamma_{2,t}$ -- well before USPRIV starts showing signs of an imminent downturn. Since $F_2$ is already composed mostly of forward-looking variables, this hints at a convex effect of market-based expectations proxies.
Lastly, a word of caution. Given the points raised earlier in section (ref), it is more appropriate to see these surrogate trees as suggestive of one potential explanation. It is an open secret that their exact structure is sensitive to small changes in the estimated path. For instance, little variation in $\beta_t$ is needed to observe a change in the exact choice of variables itself. As a result, some of them may rightfully seem exotic when singled out in such a simple tree. GTVPs, as the product of a forest, will more often than not rely on a multitude of indicators from a specific group (which we observe in Figure (ref)) rather than a single indicator.
As detailed in Appendix (ref), FA-ARRF is a very competitive model for monthly inflation at all horizons. By its use of $F_1$, the real activity factor, it has the familiar flavor of a Phillips' curve (PC).\footnote{As noted in stock2008phillips, the plethora of output gap indicators used in literature makes the use of a common statistical factor a credible alternative.} This is of interest given PCs have at best a very uneven forecasting track record atkeson2001phillips,stock2008phillips,faust2013forecasting. For instance, simple autoregressive/random walk/historical mean benchmarks often do much better.
Given its paramount importance within New Keynesian models, many explanations have been proposed for PC forecasts failures. The curve could be time-varying in a way that annihilates its forecasting potential stock2008phillips. Closely related, some have stipulated the PC is nonlinear dolado2005monetary,doser2017inflation,linde2019resolving,mineyama2020downward. If that were to be true, this should be exploitable. Lastly, an adjacent point of view, which became increasing popular following the Great Recession, is that the PC has irreversibly flattened to the point of predictive desuetude blanchard2015inflation,blanchard2016phillips,del2020s. Unlike the first two propositions, this one is, by nature, terminal.
Of course, all those explanations amount to hypotheses on the nature of $\gamma_{1,t}$'s time variation, of which MRF provides a very flexible account. It is worth emphasizing that MRF is estimated up to 2007Q2, unlike many of the above models explaining the "missing disinflation" after observing that it took place.\footnote{Indeed, they do so either by fitting the post-2008 data directly, or by choosing a specification (or building a theoretical model) directly inspired by the experience of the Great Recession.} The variable importance measures reported in Figure (ref) showcase a "consensus" subset of variables that matters for inflation time variation. Three popular ones are the trend, MAF of building permits and MAF of housing starts. The leading role for the trend suggests that exogenous time variation is important to explain inflation -- to no one's surprise cogley2001evolving. Studying $\beta_t$-specific VI's suggest that this is mostly a feature of the intercept and persistence.
Figures (ref), (ref) and (ref) allow to re-conciliate PC forecasting evidence. For instance, a visible PC death zone spans all of the 90s, which constitutes most of the sample used in atkeson2001phillips.\footnote{The decade-long wedge between the OLS estimate and GTVP in Figure (ref) nicely explains PC failures.} It also includes the post-2008 period, which motivated blanchard2015inflation's inquiry. Most interestingly, for the latter era, $\gamma_{1,t}$ is predicted to head toward 0 out-of-sample. To clarify, the parameter is driven by post-2008 data, but the structure itself ($\mathcal{F}$) is not re-evaluated past the dotted line.
By looking at predictive performance results ex-post, stock2008phillips report that Phillips' curve forecasts usually outperform univariate benchmarks around turning points, but suffer a reversal of fortune when the output/unemployment gap is close to 0. They note that the finding "cannot yet be used to improve forecasts" because their gap relies on a two-sided filter. More recently, KLS2019 reinforce this view by showing an ARMA(1,1) is triumphant for inflation except in recessionary periods, where a data-rich environment can be helpful. But to capitalize on this, one needs a recession/expansion forecast. MRF recognize this potential and relies on leading indicators of the housing market to activate $\gamma_{1,t}$ in a timely manner. This is particularly evident from looking at $\gamma_{1,t}$'s VI measure in Figure (ref) and its resulting GTVP in Figure (ref). Overall, we see that the relationship between inflation and economic activity is episodic, as conjectured by stock2008phillips, and often prevails before recessions (but not all). Figure (ref) proposes a clear-cut answer: inflation responds to the real activity factor when the housing market is booming.
For a long time, housing sector indicators have been known as predictors of future economic activity stock1998business,leamer2007housing. However, when it comes to forecasting inflation itself, including leading indicators (like permits) does not remedy Phillips' curve forecasts failures stock2007has. FA-ARRF differs by not using housing permits/starts as a replacement and/or additional output gap proxy. Rather, its role is to increase the curvature when the time is right. As mentioned above, one explanation is that housing starts and permits are proxying for future economic activity, resolving the conundrum posed by stock2008phillips. Overall, this implies a PC which would be highly nonlinear in real activity, as further inquired in section (ref). Another hypothesis is that MRF discovers -- through aggregate data -- how to leverage stock2019slack's insights that some components of inflation are much more cyclically sensitive than others. stock2019slack show that the most cyclical component of inflation is housing, followed closely by food components. Accordingly, MRF activating $\gamma_{1,t}$ with building permits and housing starts is the algorithm's way of predicting when more cyclically sensitive components take the front stage -- and by doing so, revive the Philipps' curve. In sum, nonlinearities would be a consequence of aggregation.
The predictive PC studied here differs in many aspects from those studied, for instance, in blanchard2015inflation. Importantly, $F_1$ summarizes mostly variables in first differences (or growth rates). A typical gap measure, being a deviation from a trend, will be much more persistent. Also, it remains negative for many years following a downturn. In contrast, $F_1$, which is strongly correlated with UR change, will go back up as soon as UR stops growing. To validate current insights and obtain new ones, I now study a prototypical Phillips' Curve.
The behavior of inflation since the Great Recession -- starting with the missing disinflation and followed by "missing inflation" of recent years -- sparked renewed interest in the Phillips curve. Much attention has been given to its hypothesized flattening blanchard2015inflation,galigambetti2019, del2020s. This body of work supports the view that the PC coefficient (either reduced-form or semi-structural) has substantially declined over the last decades. The focus on slow structural change is operationalized by the modeling strategy -- either random walk TVPs or sample splitting at a specific date. coibion2015phillips show less worry about PC's health. They rationalize post-2008 inflation with a simple OLS PC where expectations are based on consumer survey data rather than lags or professional forecasters. del2015inflation demonstrate that a standard DSGE (which encompasses a structural New Keynesian PC) is not baffled by post-2008 inflation since it relies on model-based forward-looking expectations of future marginal cost. More recently, linde2019resolving and mineyama2020downward articulate theories supporting a nonlinear specification for the reduced-form PC, which could also account for the inflation puzzles punctuating the last 12 years. Given this background and forecasting results reported earlier, a traditional PC must be a fertile ground for MRF-based detective work.
I contribute to the literature by fitting an MRF which linear part corresponds to an expectations-augmented Phillips' curve. $X_t$ is inspired by what blanchard2015inflation (henceforth BCS) considers:
where $\pi_t $ stands for CPI inflation, $\hat{\pi}_t^{LR}$ and $\hat{\pi}_t^{SR}$ respectively for long-run and short-run inflation expectations. ${u}_t^{GAP}$ represents the (negative) unemployment gap and ${\pi}_t^{IMP}$ is import prices inflation. I translate this to the MRF framework by making $\mu_t = \theta_t \hat{\pi}_t^{LR}$ the time-varying intercept, letting $\beta_{t,1} = 1-\theta_t$ and by obtaining ${u}_t^{GAP}$ by means of Hodrick-Prescott filtering.\footnote{Specifically, both this gap and that of BCS get out of negative territory around 2014.} As in BCS, $\hat{\pi}_t^{SR}$ is the average inflation over the last four quarters. Hence, the estimated equation
does not impose the constraint implied by $\theta_t$ in equation (ref). However, estimation results will desirably have $\beta_{1,t} \in [0,1]$ at almost any point in time. $S_t$ is the same as that considered in the forecasting section. The data set runs up to 2019Q4.
Figure (ref) reports GTVPs of interest: the weight on short-run expectations and the output gap coefficient. Additionally, it contains traditional TVP estimates as means of comparison. The latter convey the usual wisdom: inflation expectations slowly start to be more anchored from the mid 1980s. Around the same time, the unemployment/inflation trade-off begins its slow collapse. The updated data shows that the TVP-based Phillips' curve has further flattened to plain 0 in the last decade.
For $\beta_{1,t}$, the weight on short-run expectations, both methods agree that it has been decreasing steadily after the 1983 recession. But GTVPs highlight an additional pattern for the importance of $\hat{\pi}_t^{SR}$: it tends to increase during economic expansions, collapse during recessions then start increasing again until the next downturn. Note that the phenomenon is also observed in Figure (ref) for the simpler ARRF on quarterly inflation. The decrease in the coefficient (usually of about 0.25) is observed for every recession and usually last for some additional quarters after the end of it. The linear rise in the coefficient occurs for all expansions except those preceding the early 90s and 2000s recessions, where the pattern is punctuated with additional peaks and troughs. The increased importance of short-run expectations with the age of the expansion is also observed for recent expansionary periods. Hence, the phenomenon is not merely a matter of the 70s and 80s recessions being preceded by a sharp acceleration of inflation.
From a more statistical point a view, the sharp decline in $\beta_{1,t}$ following every recession suggests that in the aftermath of an important downward shock, the long-run inflation expectation is a more reliable predictor as it is minimally affected by recent events. As the expansion slowly progress (and recessionary data points get out of the short-run average), $\hat{\pi}_t^{SR}$ becomes a more up to date and reliable barometer of future inflation conditions. This narrative is corroborated by variable importance (Figure (ref)) for $\beta_{1,t}$, which highlights the importance of the trend, but also recent lags of inflation.
When it comes to the low-frequency movement of the unemployment gap coefficient, both methods agree about a significant decline starting from the 80s. However, GTVPs uncover additional heterogeneity. First and most strikingly, $\beta_{2,t}$ gets very close to 0 following every recession. This suggests a nonlinear Philipps' curve where inflation responds strongly to a very positive ${u}_t^{GAP}$ but not so much to a negative one. Second, the 70s and early 80s are characterized as a series of peaks (preceding the first three recessions of the sample) rather than a sustained high coefficient. Traditional TVPs, by excessive time-smoothing, dissimulate the effects of inflationary spirals on $\beta_{2,t}$. Such pre-recession accelerations still occur during the Great Moderation but in a much milder way.
Third, VI measures (in Figure (ref)) confirm the importance of activity indicators (like Total Capacity Utilization (TCU)) in driving $\beta_{2,t}$ itself. The correlation between $\beta_{2,t}$ and TCU is 0.81, and the correspondence between the two variables is striking in Figure (ref). Many notable increases in $\beta_{2,t}$ are nicely matched (between the two 70s recessions and before 2008). Of course, this simple characterization remains imperfect since it misses some highs (like the end of the 70s) and predicts a higher $\beta_{2,t}$ in the years following the 2008-2009 recession. Generally, given the strong co-cyclicality between TCU and ${u}_t^{GAP}$, this is evidence of a convex PC.
The collapse of $\beta_{2,t}$ following recessions is not unique to 2008: it happened following every recession since 1960. As a result, inflation will rise when the economy is running well above its potential, but much more timidly will it go down from economic slack. Recently, linde2019resolving have shown that such a phenomenon can be rationalized by a New Keynesian DSGE model. Indeed, by allowing for additional strategic complementarity in firms price- and wage-setting behavior and solving the nonlinear model (rather than considering the linear approximation around the steady state), the authors obtain a state-dependent PC which becomes very flat during large downturns. This can explain both the small coefficient during recessions and its subsequent timid increase. Theoretically, convexity can also emerge from downward wage rigidities mineyama2020downward, but its empirical plausibility for the post-2008 era has been contested coibion2015phillips.
This pattern remains when adding controls in the linear part for supply shocks and monetary policy shocks. Those are the usual confounding factors suspected of blurring the relationship by introducing a positive correlation between unemployment and inflation.\footnote{While the time-varying constant can go a long way at controlling for such factors -- being a RF in itself, including them in the linear part makes them "stand out" as everything going through the intercept is inevitably heavily regularized.} The economic suspicion particular to this application is that omitting them could create a downward bias in $\beta_{2,t}$ that only occurs locally, generating the cyclical pattern. As it turns out, controls make cyclicality even more obvious in Figure (ref), especially for the later part of the sample.\footnote{Results being similar for both curves is reminiscent of galigambetti2019 who report little differences between paths of reduced-form and semi-structural wage PCs (although they focus on long-run change).} However, the overall strength of the coefficient is smaller (especially for the 70s).
Many hypotheses can be accommodated by a model estimated on two disjoint samples, like in del2020s. Much fewer of them are compatible with the richer $\beta_{2,t}$ path extracted by MRF. This is important: learning the type of nonlinearity, rather than partially imposing it, helps in discriminating economic suppositions. Figure (ref) and recent theoretical developments both suggest that much of the PC's decline is attributable to upward nonlinearities being less solicited in the last 3 decades. This is in accord with the policy hypothesis: since Paul Volker's chairmanship the monetary authority has responded much more aggressively to inflationary pressures, limiting the spirals that gave rise to high $\beta_{2,t}$'s in the 70s. Two conclusions emerge from this observation. First, exogenous change cannot so simply be ruled out. Second, knowing what were MRF beliefs about PC nonlinearities at different points in time could be enlightening.
$\beta_{2,t}$'s lows are getting lower, and longer. Should we have known? Much of the recent work on PC is directly inspired by Great Recession aftermath, and aims at explaining it. Whether it is theoretical or empirical work, much of it could be overfitting: a model can replicate one or two facts it is trained to replicate, but fails to generalize. That is, even if models are tested out-of-sample (which is itself not so often the case in the literature), the choice of nonlinearity itself is often determined in attempt to match the OOS. Beyond the linear part being a PC, MRF does not assume much --- and its nonlinearities are certainly not "personalized" to the recent inflation experience. Thus, it is interesting to ask: what was MRF "thinking" about $\beta_{2,t}$ in 2007? in 1995? Did it know something we did not, or did it learn (as most economists) of PC's collapse from the post-2008 experience? I conduct a $\beta_{2,t}$ dynamic learning exercise to find out.
To make this operational, MRF is estimated up to 1995, 2007 and 2019, and GTVPs are projected out-of-sample from those dates (when applicable). To be clear, $\hat{\beta}_{2,t|1995}=\hat{\mathcal{F}}_{1995}(S_t)$ means the coefficient predictive structure is last estimated in 1995. Coefficients keep moving out-of-sample because $S_t$ does. $\hat{\mathcal{F}}_{1995}(S_t)$ and $\hat{\mathcal{F}}_{2007}(S_t)$ will differ for two main reasons. The first is estimation error -- both in terms of precision and re-evaluating which nonlinearity seems more appropriate.\footnote{The second part has the flavor of model selection "error".} The second is structural change, perhaps completely exogenous or triggered by policy interventions.
Much can be learned from Figure (ref). First, GTVPs are all very alike for the pre-1995 period, suggesting little was observed post-1995 that made MRF change its reading of the past. Similarly, the green and the magenta line, which both share the 1995-2007 period within their training sets, are close to one another. Overall, this indicates that OOS difference between paths are very unlikely due to a better re-estimation and/or a completely new choice of $\mathcal{F}$.
Second, unlike what we have seen for the unemployment equation (Figure (ref)), there are important disparities between the ex-ante and the ex-post paths out-of-sample. Thus, one can rightfully hypothesize that structural change got in the way, making $\hat{\mathcal{F}}_{1995}$'s attempt of replicating the strong nonlinearities of the 70s into the 2000s go wildly off course. An analogous (yet far less noticeable gap) punctuates the post-2007 period. This suggests that while $\beta_{2,t}$ was expected to fall marginally following the crisis and stay low thereafter (according to $\hat{\mathcal{F}}_{2007}$), it was not expected to go that low. Indeed, only $\hat{\mathcal{F}}_{2019}$ hits 0 and stays in its vicinity.
Of course, by design, exogenous structural change cannot be captured out-of-sample -- with the results that we know ($\hat{\mathcal{F}}_{1995}$). This dismal predicament does not apply to cyclical behavior: it has been forecastable at least since 1995. Indeed, $\hat{\mathcal{F}}_{1995}$ propose a $\beta_{2,t}$ for 2000 and 2008 that is very similar to that of 70s inflation spirals. Moreover, $\hat{\beta}_{2,t|1995}$'s collapse following 2008 is of a magnitude only seen during Arthur Burns' days. Hence, a much weaker PC following large downturns is hardly new. However, what $\hat{\beta}_{2,t|2007}$ and $\hat{\beta}_{2,t|2019}$ tell us is that the overall amplitude (and level) of those variations has evolved exogenously, forcing MRF to update $\mathcal{F}$ repeatedly.
This exercise may rightfully seem exotic, with no obvious analog in the literature. The simple explanation is that traditional time variations only give "trivial" parameter forecasts by construction, and there is no clear "learning" process to analyze. For example, the "forecasted" random walk TVP would be a straight line over the whole OOS. Doing so with a threshold model would only inform us of the increasing precision of estimation as sample size grows -- i.e., the model itself cannot be re-evaluated. Unlike traditional nonlinear methods, MRF provides non-trivial $\beta_t$ paths out-of-sample --- and discovers exogenous structural change instead of imposing it.
I proposed a new time series model that (i) expands multiple nonlinear time series models, (ii) adapts Random Forest for macro forecasting and (iii) can be interpreted as Generalized Time-Varying Parameters. On the empirical front, the methodology provides substantial empirical gains over RF and competing non-linear time series models. The resulting Generalized TVPs have a very distinct behavior vis-à-vis standard random walk parameters. For instance, they adapt nicely to regime-switching behavior that seems pervasive for unemployment -- while not neglecting potential long-run change. This finding is facilitated by the fact that GTVPs lend themselves much more easily to interpretation than either standard RF or random-walk TVPs. Indeed, rather than trying to open the back box of an opaque conditional mean function (like one would with plain RF), MRFs can be compartmentalized in different components of the small macro model. Furthermore, GTVPs can be visualized with standard time series plots and credible intervals are provided by a variant of the Bayesian Bootstrap.
When looking at Phillips' curves in general, MRF finds both structural change in the persistence and regime-dependent behavior in the economic activity/inflation trade-off. In particular, a recurrent theme across all specifications is that the slowly decaying curve is also much steeper when the economy is overheating -- in line with the convexity/nonlinearity hypothesis. Hence, MRF can be of great help sorting out what is plausible and what is not when it comes to macroeconomic equations with a history of controversy. Since there is no shortage of those, MRF holds many possibilities for future research.
\setstretch{0.75}