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.
79,548 characters · 17 sections · 56 citation commands
Extending the Scope of Inference About Predictive Ability to Machine Learning Methods
\def\spacingset#1{ {#1}} \spacingset{1}
\if00 \fi
\if10 {
} \fi
{\it Keywords:} Predictive ability; Machine Learning; Martingale difference hypothesis.
\spacingset{1.8}
Out-of-sample evaluation of predictive models has become a key feature of modern machine learning methods (see, e.g. james2023introduction, for a textbook treatment, and mullainathan2017machine, for an applied econometrics perspective). It also has a long tradition in time series econometrics, with important contributions by diebold1995comparing and west1996asymptotic. These existing asymptotic justifications for predictive inference provide a formal framework for quantification of prediction uncertainty. However, these classical results do not directly carry over to modern machine learning applications, see, e.g. masini2023machine for a review. In this paper, we point out two key properties for valid standard inference on predictive performance with machine learning methods: (i) a zero-mean condition for the score of the prediction loss function; and (ii) a \textquotedblleft fast rate\textquotedblright\ of convergence for the machine learner. Absent any of these conditions, the estimation risk may be unbounded, and inferences invalid and very sensitive to sample splitting.
The zero-mean condition of the score of the prediction loss function holds in a number of important examples, including the leading and canonical example of the Mean Squared Prediction Error (MSPE) loss function with machine learning estimators for optimal linear projections (e.g. Lasso). \footnote{To illustrate, among all papers published at the Journal of Business and Economic Statistics and Journal of Econometrics in 2008 doing forecast evaluation, 83% of them use the MSPE loss function, see Table 1 in gneiting2011making.} The zero-mean score condition holds when the same loss function is used for estimation in-sample as for out-of-sample evaluation. Yet, it is common practice to use different loss functions for estimation and evaluation. Our requirement of zero-mean score of the prediction loss function at the limit of the in-sample estimator can be understood as a weak (local) version of the \textquotedblleft consistent scoring rule condition\textquotedblright\ in gneiting2011making. This zero-mean condition of the score is also related to the local robustness property discussed in chernozhukov2022locally. Our paper goes beyond the debiasing literature in emphasizing the importance of the fast rates of the machine learner, even when the zero-mean score property (i.e. local robustness) holds. Also, we build on the classical literature on predictive ability tests in time series econometrics, extending its scope to machine learning methods.
As the main result of the paper, we give general sufficient conditions under which the estimation risk component of the out-of-sample risk is asymptotically negligible and standard inference on predictive performance applies, as in diebold1995comparing. In this standard case, the asymptotic distribution of the out-of-sample risk does not depend on the limit out-of-sample to in-sample size ratio and the possibly non-normal asymptotic distribution of the machine learning estimator. Thus, we provide conditions under which the popular diebold1995comparing and west1996asymptotic forecast evaluation approaches are simultaneously valid with machine learning predictions, both leading to the same \textquotedblleft standard\textquotedblright\ asymptotic inferences. The main practical implications of our results are that we provide regularity conditions under which (i) commonly done horse-race predictive comparisons between machine learning methods and/or classical methods are valid and theoretically justified, see, e.g., makridakis2018statistical for an influential study with such comparisons; (ii) these comparisons are less sensitive to sample splitting, and (iii) estimated asymptotic confidence intervals for the predictive risk, say at 95%, are valid and have the usual expression of the out-of-sample empirical risk $\pm $ two times the standard error (no correction for estimation risk is necessary). We recommend reporting confidence intervals, together with point estimates of out-of-sample risk.
We document theoretically and by simulations the following points. First, even when the score of the prediction loss function has zero-mean, the estimation risk part of the out-of-sample empirical risk can diverge due to the slow rates of the machine learning estimator. Thus, fast rates for the machine learner are somewhat necessary for standard inference on predictive performance to be valid. The precise definition of fast rates is given below in equation ((ref)). When both the zero-mean and the fast rates hold, the estimation risk is asymptotically negligible and standard inference on the out-of-sample risk applies. We find that the standard asymptotic theory provides a more accurate approximation with machine learning methods when the ratio of the out-of-sample period to in-sample period is smaller than the typical choice of one (a choice of 0.25 works well in our simulations). For mixing processes, fast rates are attainable for popular machine learning estimators, such as Lasso, Deep Learning, Boosting, and others, under suitable regularity conditions, see Section 4 in the Supplementary Material.
The scope of this paper is restricted to machine learning estimators satisfying a fast rate condition and a class of prediction loss functions whose corresponding risk satisfies a Lipschitz property. This class includes prominent examples such as the MSPE, the Mean Absolute Deviation (MAD) error, the Huber loss, the ASymmetric MSPE (ASMSPE) loss, the Log-Cosh loss, the Cross-Entropy loss, and many others. See Section 2.2 below, and Section 2.1 in the Supplementary Material for further discussion on losses. The machine learner and loss function must also satisfy a stochastic equicontinuity condition, see, e.g., andrews1994asymptotics for the same condition. This equicontinuity condition has been shown to hold in wide generality with machine learners, see, e.g., Theorem 14.20 in wainwright2019high.
We illustrate the wide applicability of the general theory with three applications. First, we consider high-dimensional time series regressions with the Lasso and the MSPE prediction loss. Second, we study Deep learning for prediction with a binary outcome using the Cross-Entropy loss. Finally, we propose a new out-of-sample test for the Martingale Difference Hypothesis (MDH) with a Ridge estimator and a covariance loss function. We apply it to study the predictability of some leading exchange rates. We propose a self-normalized test statistic measuring the sample covariance between the outcome and the machine learning predictions. In all these applications, we provide primitive conditions under which the out-of-sample risk converges to a normal distribution. Extensive Monte Carlo simulations confirm our theoretical results. An empirical application to exchange rates shows the ability of our MDH test to detect linear and nonlinear predictability patterns in the data, complementing traditional Portmanteau tests. Our study contributes to the extensive and growing literature on the use of machine learning methods for time series predictability, providing theoretical asymptotic guarantees for predictive ability with machine learning methods.
Our paper has some important limitations too. One limitation is that we only consider the case of zero-mean score. We expect that if the score of the prediction loss function does not have zero-mean the estimation risk will generally diverge in the high-dimensional setting (even under fast rates of convergence of the machine learner), though proving so is beyond the scope of this paper. We report simulations in Section 2.4 of the Supplementary Material supporting this claim. Another limitation is that we consider stationary mixing data. The analysis of structural breaks and non-stationarity is also beyond the scope of this paper. Finally, inferences under slow rates remain unknown in the literature and we are not an exception to this. We will investigate these interesting extensions in future research.
The rest of the paper is organized as follows. The next section describes the problem and the main general results. In Section 3, we consider the application to high-dimensional time series regressions with the Lasso and the MSPE loss, including Monte Carlo simulations to support our theory. Section 4 reports the application to Deep learning for prediction of binary outcomes with the Cross-Entropy loss. Section 5 considers the third application to out-of-sample testing for the MDH based on machine learning predictions. This section also evaluates the finite sample performance of the new MDH tests via simulations and an empirical application to exchange rates data. Finally, Section 6 concludes. The proofs and extensive Monte Carlo sensitivity checks are gathered in a Supplementary Material.
A word on notation. For a matrix or vector $A,$ $A^{\prime }$ denotes its transpose, $tr(A)$ its trace, $vec(A)$ the vector obtained by concatenating the column vectors of $A$, and $\left\Vert A\right\Vert =\sqrt{tr(A^{\prime }A)}$ its Euclidean norm. If $A$ is positive semidefinite and symmetric, $\lambda _{\max }(A)$ and $ \lambda _{\min }(A)$ denote its maximum and minimum eigenvalue, respectively. For a vector $v=(v_{1},...,v_{p})^{\prime },$ $\left\Vert v\right\Vert _{1}=\sum_{j=1}^{p}\left\vert v_{j}\right\vert $ is the $l_{1}$ norm$\ $and $\left\Vert v\right\Vert _{\infty }=\max_{1\leq j\leq p}\left\vert v_{j}\right\vert $ is the max norm. Henceforth, $C$ is a positive constant independent of the sample size and the parameter dimension $p$, and that may change from expression to expression. When we need more than one constant in a given expression, we use $C_{1},$ $C_{2},c_{1},$ $c_{2}$, etc. We will use the acronyms wpa1 and wrt for \textquotedblleft with probability approaching one\textquotedblright\ and \textquotedblleft with respect to\textquotedblright , respectively. For two positive sequences $a_{T}$ and $b_{T},$ we will write $a_{T}\lesssim b_{T}$ when for some $C\in (0,\infty )$ it holds that $\lim \sup a_{T}/b_{T}\leq C$ . Further, we write $a_{T}\approx b_{T}$ if $a_{T}\lesssim b_{T}\lesssim a_{T}$. We generalize this notation to random variables and use $a_{T} \mathrm{\lesssim }_{\mathbb{P}}b_{T}$ to denote $a_{T}=O_{\mathbb{P}}(b_{T})$. Henceforth, $R$ and $P=T-R$ are the in-sample and out-of-sample sizes, $T$ is the total sample size, and $ \hat{E}_{R}$ and $\hat{E}_{P}$ are, respectively, the in-sample and out-of-sample mean operators
We are interested in out-of-sample inference on the moment
depending on an unknown $p$-dimensional parameter $\theta _{0}\in \Theta \subset \mathbb{R}^{p},$ and where the moment function $f_{t}(\theta _{0})$ also depends on observable data at time $t,$ i.e., $f_{t}(\theta _{0})=f(Z_{t},\theta _{0}).$ The function $f_{t}(\theta _{0})$ is referred to as the prediction loss function here or the scoring function in gneiting2011making. The data is a strictly stationary sample $ \{Z_{t}\}_{t=1}^{T}\ $of sample size $T.$ The parameter $\theta _{0}$ satisfies
for an estimating moment function $h_{t}(\theta ),$ possibly but not required to be different from $f_{t}(\theta ).$ For a fixed $p,$ this is the setting considered in west1996asymptotic. When $f_{t}(\theta _{0})$ is the loss differential of two forecasts, this is the setting considered in diebold1995comparing. Our framework can be trivially extended to multivariate moments, thereby including conditional predictive ability tests such as those developed in giacomini2006tests. We investigate extensions of this classical theory, permitting a high-dimensional setting where $p$ is potentially much larger than the sample size $T,$ with $ p\rightarrow \infty $ as $T\rightarrow \infty ,$ and considering estimators that are not necessarily asymptotically linear or normal.
Example (MSPE and Lasso): A leading example of loss function $f_{t}(\theta _{0})$ is the Squared Prediction Error (SPE) moment function where $f_{t}(\theta _{0})=\left( Y_{t}-\theta _{0}^{\prime }X_{t}\right) ^{2}\ $and $Z_{t}=(Y_{t},X_{t}^{ \prime })^{\prime }$. In this example, $X_{t}$ is a $p$-dimensional vector of predictor variables, possibly including lagged values of the dependent variable $Y_{t},$ and $\theta _{0}$ is an unknown parameter estimated by a Lasso estimator with the first $R$ observations, $1\leq R<T,$ as
where $\lambda _{R}$ is a penalization parameter, $\lambda _{R}\downarrow 0$ as $R\rightarrow \infty ,$ and $h_{t}(\theta )=\left( Y_{t}-\theta ^{\prime }X_{t}\right) ^{2}$. $\blacksquare $
For simplicity of exposition, we focus on the so-called fixed forecasting scheme, though our results could potentially be extended to different forecasting schemes such as the recursive and rolling forecasting schemes, following the proof of Theorem 1 in escanciano2010backtesting . Henceforth, we denote by $\widehat{\theta }_{R}$ the in-sample estimator of $\theta _{0}$ in ((ref)). An example is the Lasso estimators in ((ref)), but other machine learning estimators are possible.
The expected loss function or risk $E[f_{t}(\theta _{0})]$ is estimated by the empirical out-of-sample risk $\hat{E}_{P}\left[ f_{t}( \widehat{\theta }_{R})\right] $. As in west1996asymptotic, we aim to establish asymptotic distribution theory for
Unlike west1996asymptotic, we allow for a high-dimensional setting where $p$ is potentially much larger than the in-sample estimation period $R$ and/or the out-of-sample period $P.$
A key component in the asymptotic analysis of $\Delta $ is the Estimation Risk ($ER$) component, defined from the following expansion as
A standard Taylor expansion argument yields
where $\dot{f}_{t}(\theta _{0})=\partial f_{t}(\theta _{0})/\partial \theta $ is the score of the loss function, when it exists. Thus, in the classical fixed $p$ setting, the asymptotic linearity of $\sqrt{P}\left( \widehat{ \theta }_{R}-\theta _{0}\right) $ yields an asymptotic normal distribution for the $ER$ under mild moment conditions. The analysis of west1996asymptotic can be modified to relax the asymptotic linearity of the estimator, as long as $\sqrt{P}\left( \widehat{\theta }_{R}-\theta _{0}\right) =O_{\mathbb{P}}(1)$ and $E\left[ \dot{f}_{t}(\theta _{0})\right] =0,$ since under these conditions
where $\rightarrow _{\mathbb{P}}$ denotes convergence in probability. However, the assumption of $\sqrt{P}-$consistency of $\widehat{\theta }_{R}$ is too strong in the high-dimensional setting. Machine learning estimators generally have a slower rate of convergence than $P^{-1/2}$. The following subsection shows that even in a stylized example (Gaussian errors and correctly specified linear model), the $ER$ is no longer asymptotically bounded under the so-called slow rates for the machine learner.
Consider a stylized example of a Gaussian prediction error $ \varepsilon _{t}=Y_{t}-\theta _{0}^{\prime }X_{t},$ with zero-mean, where $ \{\varepsilon _{t}\}_{t\in \mathbb{Z}}$ are independent and identically distributed (iid), independent of $\mathcal{X},$ the $\sigma $-algebra generated by $\{X_{t}\}_{t=-\infty }^{\infty },$ and with variance $\sigma ^{2}=E[\varepsilon _{t}^{2}].$ Also, $\{X_{t}\}_{t=-\infty }^{\infty }$ are iid $N(0,\Sigma )$. We consider the SPE loss $f_{t}(\theta _{0})=\left( Y_{t}-\theta _{0}^{\prime }X_{t}\right) ^{2},$ with a general machine learning estimator $\widehat{\theta }_{R}$ of $\theta _{0}.$ Simple algebra shows that, under our assumptions, the conditional distribution of the $ER$, conditional on $\mathcal{X}$ and $ \widehat{\theta }_{R},$ is normally distributed, with mean and variance given, respectively, by
where $\overset{d}{\sim }$ means distributed as, $\hat{r}_{R}^{2}=(\widehat{ \theta }_{R}-\theta _{0})^{\prime }\hat{\Sigma}(\widehat{\theta }_{R}-\theta _{0})$ and $\hat{\Sigma}=\hat{E}_{P}\left[ X_{t}X_{t}^{\prime }\right] .$ The out-of-sample predictive risk, $\hat{r}_{R}^{2},$ or its expected value $ r_{R}^{2}=E\left[ \left( X_{t}^{\prime }(\widehat{\theta }_{R}-\theta _{0})\right) ^{2}\right] ,$ as well as other related quantities such as $ l_{2}-$rates and in-sample predictive risk, have been extensively investigated in the machine learning literature, see the references given below. For example, greenshtein2004persistence provide general conditions for the consistency of Lasso in the iid case in a metric asymptotically equivalent to $\hat{r}_{R}^{2},$ namely
where $\Sigma =E\left[ X_{t}X_{t}^{\prime }\right] $. That is, greenshtein2004persistence found conditions for $\tilde{r} _{R}^{2}\rightarrow 0$ as $R\rightarrow \infty$ (in which case the estimator is called persistent).
{ Next, it is natural to study the rates at which $r_{R}^{2},$ }$ \tilde{r}_{R}^{2}$ { or} { $\hat{r}_{R}^{2}$ go to zero with }$R.${ \ Under general conditions on predictors only the so-called slow rates are possible, see, e.g., rigollet2011exponential and dalalyan2017prediction, where
Therefore, in the common practical case where the relative out-of-sample size to in-sample size is positive, i.e. $\lim_{T\rightarrow \infty }P/R>0,$ one has $\sqrt{P}r_{R}^{2}\rightarrow \infty .$ Our first observation is that under general conditions on the sample splitting ($R$ is not necessarily large relative to $P$) and the parameters }$(\theta _{0},\Sigma ,\sigma ),${ \ the $ER$ diverges. Define the }$l_{1}$ { ball with radius }$r>0,${ \ }$B_{1}(r)=\left\{ v\in \mathbb{R}^{p}:{\normalsize \left\Vert v\right\Vert _{1}\leq r}\right\} $ { \ and emphasize the dependence of }$\hat{r}_{R}^{2}$ { \ on }$\widehat{\theta }_{R}$ { and }$\theta _{0},$ { \ }$\hat{r}_{R}^{2}(\widehat{\theta }_{R}{\normalsize ,}\theta _{0}).$
{ This simple observation shows that even in a favorable situation where the model is correctly specified and the score of the loss function has zero-mean, the $ER$ will diverge in general. This result has important practical implications because often researchers choose $P$ of a similar magnitude to $R$ (two-fold validation with equal sample sizes), which implies the condition $\sqrt{P}r_{R}^{2}\rightarrow \infty \ $ holds in the presence of slow (minimax) rates for machine learners (i.e. when the machine learner satisfies ((ref)) with equality). The second part of Proposition (ref) gives a lower bound that holds for any machine learning estimator (the $\inf$ is over all possible estimators). This result follows from raskutti2011minimax. Therefore, the problem we point out is not specific to the Lasso but it is rather related to the fundamental or information-theoretic limitations of the statistical problem at hand and apply to general machine learners.}
Therefore, some additional assumptions are necessary to achieve faster rates for machine learners. These additional conditions have been well investigated in the literature, see the so-called \textquotedblleft restricted eigenvalue conditions\textquotedblright\ for fast rates of convergence for Lasso estimators in, e.g., bickel2009simultaneous and van2009conditions, or smoothness and compositional adaptive rates for Deep learning in schmidt2020nonparametric, among others.
{ In this section we consider a relatively general setting that leads to valid asymptotic predictive inference in a high-dimensional framework. We introduce high-level assumptions here and provide low-level, primitive, conditions in Sections 3, 4 and 5 for important examples. Let }$ F_{Z}$ { denote the cumulative distribution function of the random vector $Z_{t}=(Y_{t},X_{t})$}$.$ { Define the mean operator }$E_{Z}\left[ f_{t}(\widehat{\theta }_{R} )\right] =\int f(\widehat{\theta }_{R} ,{\normalsize z} )dF_{Z}(z)$ (note this is random). { Henceforth, we consider loss functions of the form }$f_{t}(\theta )=\ell(Y_{t},m(\theta ,X_{t})),${ \ for a loss function }$\ell${ \ and a predictive model }$m(\theta ,X_{t})$ { satisfying our conditions below.}
{ \noindentAssumption A1: $R,P\rightarrow\infty$ as $ T\rightarrow \infty,$ and $\lim_{T\rightarrow\infty}P/R=\pi,$ $ 0\leq\pi<\infty$. }
{ Assumption A2:\ (Stochastic Equicontinuity, SE) The estimator and loss function satisfy the SE condition}
{ Assumption A3:\ (Lipschitz risk and zero-mean score). The loss function satisfies}
{ for all }$\theta ,\theta _{0}${ $\in \Theta $ and some positive constants $C_{1}$ and $C_{2}.$ Moreover, }
{ Assumption A4:\ (Fast rates). The estimator }$\widehat{\theta }_{R}$ { has a fast rate in the sense that}
{ Assumptions A1-A4 are standard in the literature, see, e.g., andrews1994asymptotics. We aim for asymptotic results that do not rely on $\pi=0$. We verify Assumptions A2, A3 and A4 for several examples in Sections 3, 4 and 5. These assumptions allow for a wide class of loss functions and estimators. A key assumption is the zero-mean score ((ref)), which often follows from ((ref)). We provide the main result of this section. }
{ Example (MSPE and Lasso, cont.): This example corresponds to }$\ell(y,m)=(y-m)^{2}$ { and }$m(\theta ,X_{t})=\theta ^{\prime }X_{t}.$ { We give in Section (ref) primitive conditions for the Lasso estimator to satisfy Assumptions A2 and A4, and the zero-mean condition corresponding to this loss. Assumption A3 holds with }$C_{1}=C_{2}=1.$ ${\normalsize \blacksquare } $
Table (ref) provides examples of loss functions satisfying our Assumption A3. For simplicity, we consider for the moment the case where $\ell(Y_{t},m(\theta ,X_{t}))$ is a function of $\varepsilon _{t}=Y_{t}-m(\theta ,X_{t})$. However, we note that our results are also applicable more generally. In all these cases,
for a suitable function $\psi (\varepsilon _{t})$ given in Table (ref), and $\dot{m}(\theta _{0},X_{t})=\partial m(\theta _{0},X_{t})/\partial \theta .$ Thus, the zero-mean score condition means that $E\left[ \psi (\varepsilon _{t})\dot{m}(\theta _{0},X_{t})\right] =0.$ The last column of the table verifies the zero-mean condition under the assumption that the conditional distribution of $\varepsilon _{t}$ given $X_{t}$ is symmetric around zero. See Section 2.1 in the Supplementary Material for further discussion. Henceforth, $\bold{1}(A)$ denotes the indicator of the event $A,$ equals one if $A$ holds, $cosh$ and $tanh$ denote the hyperbolic cosine and tangent functions, respectively, and sign($\cdot$) denotes the sign function.
For binary classification, a popular loss function is the Cross-Entropy or log-likelihood loss, corresponding to $\ell(y,m)=-ym+\log (1+e^{m}),$ { \ where }$y\in \{0,1\}$ { is binary. This example has a mean score }$E\left[ \varepsilon _{t}\dot{m}(\theta _{0},X_{t})\right] ,$ { where now }$\varepsilon _{t}=Y_{t}-\Lambda (m(\theta _{0},X_{t})),$ { and }$\Lambda (u)=\exp (u)/1+\exp (u)$ { is the Logit distribution.} { This score has zero-mean when }$\theta _{0}$ is { estimated by the conditional likelihood estimator or penalized versions of it.} Another commonly used loss is the covariance loss function $\ell(y,m)=ym$, which has zero-mean score when $E\left[ Y_{t}\dot{m}(\theta _{0},X_{t})\right] =0.$ This holds when $Y_{t}$ is a martingale difference sequence, see Section 5.
{ All these examples satisfy the Lipschitz condition in ((ref)) under well-known conditions. For example, for the MAD this requires that the conditional density of }$Y_{t}${ \ given }$ X_{t} ${ \ is bounded and bounded away from zero by constants }$ C_{1}${ \ and }$C_{2},${ \ respectively. The zero-mean condition is satisfied when the same loss function is used for estimation and for forecast evaluation, but it also holds generally when the error distribution is (conditionally) symmetric. When the error distribution is not symmetric and the machine learning estimator estimates the optimal linear predictor, the zero-mean score condition may not be satisfied, as we illustrate in Section 2 in the Supplementary Material with further discussion and simulations. The results for standard inference to be valid with machine learning do not apply in this case, which is beyond the scope of this paper.}
{ In the next sections, we verify Assumptions A2 and A4 under primitive conditions for several examples, starting with high-dimensional time series regressions with the Lasso and the MSPE loss function. }
{ In what follows we establish primitive conditions for Assumptions A2 and A4 to hold for the Lasso and the MSPE, i.e. $f_{t}(\theta )=h_{t}(\theta )=\left( Y_{t}-\theta ^{\prime }X_{t}\right) ^{2}\ $and }$ \widehat{\theta }_{R}${ \ as in ((ref))},{ \ building on recent work by wong2020lasso. We introduce notation and assumptions for the asymptotic results. Define the $\beta $-mixing coefficients for a time series process $\{Z_{t}\}$ as
where the supremum is over all pairs of partitions $\{A_{1},...,A_{I}\}$ and $\{B_{1},...,B_{J}\}$ of the sample space such that $B_{j}\in \mathcal{F} _{T} $ and $A_{i}\in \mathcal{P}_{T+n},$ and the $\sigma $-fields $\mathcal{F }_{T} $ and $\mathcal{P}_{T}$ are defined as $\mathcal{F}_{T}:=\sigma (Z_{t},t\leq T)$ and $\mathcal{P}_{T}:=\sigma (Z_{t},t\geq T),$ respectively$ .$ Define the sub-Weibull($\gamma $) norm of a $p$-dimensional random vector $S_{t},$ for $\gamma >0,$ as
where $\mathbb{S}^{p-1}$ is the unit sphere in $\mathbb{R}^{p}.$ }
{ Assumption A5: $\{Y_{t},X_{t}^{\prime }\}_{t\in \mathbb{Z}}$ is strictly stationary and $\beta$-mixing process with mixing coefficients satisfying for some constant $\gamma _{1}>0,$ $\beta (n)\leq 2\exp \left( -Cn^{\gamma _{1}}\right), n\in \mathbb{N},$ for a constant $\gamma _{2}>0,$ $\left\Vert S_{t}\right\Vert _{\psi _{\gamma _{2}}}<C$, for $S_{t}=Y_{t}$ and $S_{t}=X_{t}.$ }
{ Assumption A5 is from wong2020lasso and it is extensively discussed there. We also need the following assumption. We say that $\theta _{0}$ is $ s-$sparse if $\theta _{0}$ has at most }$s${ \ non-zero components}. Recall $ \Sigma =E\left[ X_{t}X_{t}^{\prime }\right]$ and $\lambda _{R}$ is the Lasso penalization parameter.
{ Assumption A6:\ (i) $\lambda _{R}\approx \sqrt{\frac{\log p}{R}};\ $(ii) for each }$p,$ $0<\lambda _{\min }(\Sigma )\leq ${ \ $\lambda _{\max }(\Sigma )\leq C<\infty $; (iii) $ \theta _{0}$ is $s-$sparse with
}
{ We also need some further notation. For $a_{t}=f_{t}(\theta _{0})-E[f_{t}(\theta _{0})],$ define $\Gamma _{a}(j)=E[a_{t}a_{t-j}]$ and $ \Omega _{a}=\sum_{j=-\infty }^{\infty }\Gamma _{a}(j)$. Assumption A5 implies that the previous long-run variance exists. With this notation in place, we can derive the following result. }
{ It is important to note that the limiting distribution does not depend on the non-Gaussian limiting distribution of the Lasso estimator in ((ref)) or the forecasting scheme (e.g. on $\lim_{T\rightarrow \infty }P/R)$. The asymptotic distribution is the same as the one in diebold1995comparing, since the $ER$ is asymptotically negligible. }
{ Several Monte Carlo experiments are conducted in order to check the finite sample performance of our asymptotic theory. First, we will consider a Data Generating Process (DGP) in which sparsity is of the same order as the root of the number of parameters, resulting in slow rates of the machine learner (here Lasso) and a divergence of the $ER$; we refer to this case as the Decreasing Sparsity case. Then, we will examine a DGP in which multicollinearity is introduced, leading to a similar divergence of the $ER$. Finally, we will present a DGP in which the Lasso estimator attains fast rates and the $ER$ converges to 0. For completeness, we provide an analysis of the eigenvalues of the covariance matrix $\Sigma =E\left[ X_{t}X_{t}^{\prime }\right] $ in Section 3 of the Supplementary Material.}
{ Consider a simple linear model in matrix form as: $Y=X\theta _{0}+\varepsilon$, where each column of the $R\times p$ matrix $X$ contains draws from i.i.d. standard Normal random variables, $\varepsilon $ is an $ R\times 1$ vector of independent $N(0,1),$ and $\theta _{0}$ is a vector with length equal to the total sample size ($p=T$) such that its first $s$ elements alternate between 1 and -1 while the rest are $0$. The parameters are estimated by Lasso with a regularization parameter $\lambda _{R}=\sqrt{ \frac{log(p)}{R}}$. For each Monte Carlo replication (500 for each DGP), we compute the $ER$ and $\Delta$ in ((ref)).
A key variable for the convergence of the Lasso and its $ER$ is the sparsity of the data. We set the sparsity index to $s=\lceil \sqrt{p}-27\rceil $, where $\lceil x\rceil $ is the ceiling function, the smallest integer greater than or equal to $x,$ corresponding to $s=5$, $s=18$, and $s=50$ for $T=1000$, $T=2000$ and $T=6000,$ respectively. We refer to this case as the decreasing sparsity case because $s$ increases (and $s/p$ decreases) with the number of parameters $p$. This level of sparsity is weak enough to make the $ER$ and $\Delta $ to diverge with $T$, as one can see from Figure (ref) and Figure (ref). As the sample size increases, the bias of both $\Delta $ and $ER$ increases. As a consequence, standard asymptotic inference as in west1996asymptotic will be invalid. The left plot of Figure (ref) considers the common case in applications where $R=P\ $( $\pi =1$). We observe large biases in the $ER\ $for this case, consistent with large values of $\sqrt{P}\hat{r}_{R}^{2}$ in our stylized example of Section 2.1.
}
{ We keep everything like in the previous DGP, except for the explanatory variables being generated and the sparsity index. Now, the first variable will be drawn from a standard normal and the rest will be constructed adding a $N(0,0.1)$ to the first variable. This will create multicollinearity, which can break the restricted eigenvalue conditions and prevent the Lasso from attaining fast rates. The sparsity index will be fixed at 15. Figure (ref) and Figure (ref) show plots for $ \Delta $ and the Estimation Risk in this case. Standard inference is again invalid due to the large biases in the $ER.$
}
{ We consider now the same DGP as in the decreasing sparsity case but now we fix the sparsity index at 5. In this framework, Lasso attains fast rates so the $ER$ converges to 0 in probability and therefore $\Delta $ converges to a zero-mean normal distribution, see Figures (ref) and (ref).
For completeness, we also report in Table (ref) the coverage probabilities for standard asymptotic confidence intervals at different nominal levels for the three DGPs. As explained by the theory, when the ratio of out-of-sample to in-sample size, $\pi ,$ is small, the bias coming from the estimation risk is less relevant. This agrees with the fact that, holding everything else constant, we get better coverage for the confidence intervals with $\pi =0.25$ than with $\pi =1$. Only for the case of fast rates the coverage is close to the nominal level and less sensitive to $\pi$ (for further results on sensitivity to $\pi$ see Section 2 in the Supplementary Material).
}
{ As a second application of our results, we consider penalized Deep learning for binary prediction. As the loss function, we use the Cross-Entropy or log-likelihood loss }$\ell(y,m)=-ym+\log (1+e^{m}),${ \ where }$y\in \{0,1\}$ { is binary, and }$ m(\theta ,x)$ { is a Deep Neural Network (DNN) model with an architecture } $(L,w),${ \ where }$L${ \ stands for the number of hidden layers or depth, and }$w=(w_{0},w_{1},...,w_{L+1})${ \ denotes the width vector. The DNN can be expressed as}
{ where }$A_{j}:\mathbb{R}^{w_{j-1}}\rightarrow \mathbb{R}^{w_{j}} ${ \ is a linear affine map, defined by }$A_{j}(x)=W_{j}x+b_{j},$ { \ for a given }$w_{j-1}\times w_{j}${ \ weight matrix }$W_{j}${ \ and bias vector }$b_{j}\in \mathbb{R}^{w_{j}},$ { \ }$\sigma _{j}:\mathbb{R}^{w_{j}}\rightarrow \mathbb{R}^{w_{j}} ${ \ is a nonlinear element-wise activation function, which we take for concreteness as the ReLU (rectilinear unit) function}$,$ { \ i.e. }$\sigma _{j}(z)=(\sigma (z_{1}),...,\sigma (z_{w_{j}}))^{\prime }${ \ with }$\sigma (z_{1})=\max (0,z_{1})$ { \ and }$z=(z_{1},...,z_{w_{j}})^{\prime }.${ \ The parameter }$\theta ${ \ gathers all the parameters of the model}
{ With }$m(\theta ,x)${ \ as in ((ref)), define the set of predictive DNN models}
{ With this notation in place, we define the penalized DNN estimator }
{ where }$\lambda _{R}${ \ is a penalization parameter such that }$\lambda _{R}\downarrow 0${ \ as }$R\rightarrow \infty ,${ \ }$\ell(y,m)=-ym+\log (1+e^{m})${ , }$\left\Vert \theta \right\Vert _{clip,\tau }=\sum_{j=1}^{p}${ $\min \left( \left\vert \theta _{j}\right\vert /\tau ,1\right) $ is the clipped }$L_{1}$ { \ norm, $\theta =(\theta _{1},...,\theta _{p})^{\prime },$ and } $\tau _{R}>0$ { is a clipping threshold. Here the tuning parameters }$(L,N,B,F,\lambda ,\tau )${ \ are all allowed to depend on the in-sample size }$R${ , with rates specified in the following results.}
{ In what follows, we establish primitive conditions for Assumptions A2 and A4 to hold for this example, building on recent work by kengne2024deep. Other applications of our results for Deep learning and mixing sequences, such as, for example, for MSPE loss and additive regression with diverging number of components, can be obtained from the work of deb2024trade. }
{ We introduce notation and assumptions for the asymptotic results. Define the }${\normalsize \alpha }${ -mixing coefficients for a time series process $\{Z_{t}\}$ as
where the supremum is over all $B\in \mathcal{F}_{T}$ and $A\in \mathcal{P} _{T+n}$. Define the prediction error term}
{ and let }$\mathcal{C}^{s}(\mathcal{X},\mathcal{K})$ { denote the class of }$s-${ H\"{o}lder functions on }$ \mathcal{X}\in\mathbb{R}^d,$ { the support of }$X_{t},$ { with radius }$\mathcal{K}>0;$ { see the definition before the proof of Theorem 4.1 in the Supplementary Material.} The following assumptions are considered in kengne2024deep.
{ Assumption A7: $\{Y_{t},X_{t}^{\prime }\}_{t\in \mathbb{Z}}$ is strictly stationary and $\alpha$-mixing process with mixing coefficients satisfying for some constant $\gamma >0,$ $\alpha (n)\leq {\normalsize C_{1}}\exp \left( -C_{2}n^{\gamma }\right) , \text{ }n\in \mathbb{N},$ for constants $C_{1},{\normalsize C_{2}}>0.$ The support }$\mathcal{X}$ { \ is a compact set of }$\mathbb{R}^{d}.$ { Moreover, }$E[\left. \varepsilon _{t}\right\vert \mathcal{F}_{t-1}]=0${ \ a.s. and }$m(\theta _{0},\cdot )\in \mathcal{C}^{s}(\mathcal{X},\mathcal{K}). $
{ Assumption A8:\ (i) $\lambda _{R}\approx R^{-\frac{\gamma }{\gamma +1}}\log (R)$ and }$\tau _{R}\lesssim (L_{R}+1)^{-1}\left[ (N_{R}+1)B_{R}\right] ^{-L_{R}-1}R^{-\frac{\gamma }{ \gamma +1}}${ $;\ $(ii) }$L_{R}\approx \log (R),$ $N_{R}\lesssim R^{\frac{\gamma c_{1}}{\gamma +1}},$ $1\lesssim B_{R}\lesssim R^{\frac{ \gamma c_{2}}{\gamma +1}},$ { for }$c_{1},c_{2}>0${ ; (iii) the following rate condition holds for a }$v>3,${ \
}
{ Fast rates for the DNN estimator hold under the key rate condition}
{ which shows a trade-off between dependence and complexity of the class (as measured by the smoothness index }$s${ \ and the dimension of covariates }$d).$ { For example, in the iid case, }$ \gamma =\infty $,{ \ the level of smoothness }$s${ \ must be larger than }$d.$ An { implication of ((ref)) is }$ \gamma >1${ \ and }$s>(\gamma +1)d/(\gamma -1),${ \ so the level of smoothness must be sufficiently large for the fast rate of convergence to hold. Assumptions like these are standard in the literature (see e.g. andrews1994asymptotics).}
{ Another illustration of the wide applicability of the previous results is a new out-of-sample test for the Martingale Difference Hypothesis (MDH), as in clark2006using but in a high-dimensional setting. The MDH is one the most prominent hypothesis in time series econometrics, with a long history; see escanciano2009b for a review. Despite the long history and developments, we are not aware of any theoretical justification of the use of machine learning predictive methods for its out-of-sample evaluation. To the best of our knowledge, ours is the first formal out-of-sample MDH test allowing for machine learners in a time series setting. }
{ This application considers the loss function suggested in clark2006using,
Let $\mathcal{F}_{t}$ denote the $\sigma $-field generated by $Y_{t},$ and possibly other variables $X_{t},$ $\mathcal{F}_{t}:=\sigma (Z_{s},s\leq t),$ $Z_{t}=(Y_{t},X_{t}).$ The vector $X_{t}$ includes an intercept, $X_{t}\in \mathcal{F}_{t-1},$ and is possibly high-dimensional. For example, $ X_{t}=(1,Y_{t-1},...,Y_{t-p})^{\prime }$ for a large $p\geq 1.$ Like in clark2006using, we aim to test the null hypothesis that $Y_{t}$ is a martingale difference sequence wrt $\mathcal{F}_{t-1},$ i.e.
against the alternative that $E[\left. Y_{t}\right\vert \mathcal{F}_{t-1}]\neq 0.$ In the fixed dimensional case, clark2006using used an asymptotic theory where $R$ and $\widehat{\theta }$ are fixed, while $P\rightarrow \infty .$ In contrast, we allow for both $R$ and $P\rightarrow \infty ,$ $ \widehat{\theta }$ is random and possibly estimated by high-dimensional methods, such as the Ridge estimator defined below. We will employ the fact that the sample version of the loss function $f_{t}(\theta _{0})=2Y_{t}X_{t}^{\prime }\theta _{0},$ suitably standardized, converges by the martingale central limit theorem (CLT) to a standard normal under the null hypothesis of the MDH. In this application,
where $\widehat{\theta }$ is an estimator based on in-sample observations, such as, for example, the Ridge estimator
One may argue that a Ridge estimator is better motivated than a Lasso estimator for testing the MDH with time series. It is well-known that Ridge performs better than Lasso in dense models where some of the coefficients, here related to the moments $E[Y_{t}X_{t}]$, are expected to be small but not exactly zero. Nevertheless, we allow for a generic estimator $\widehat{ \theta },$ not necessarily Ridge, with the requirement that the estimator does not have a probability mass at zero under the null of the MDH. This is necessary to avoid dividing by zero in our self-normalized test statistic. }
{ The asymptotic behaviour of $\Delta $ depends on whether we are under the null or under the alternative hypothesis. Under the null, it follows that $\theta _{0}=0=E[f_{t}(\theta _{0})]$ and thus $\Delta =\sqrt{P} \hat{E}_{P}\left[ 2Y_{t}X_{t}^{\prime }\widehat{\theta }\right] .$ Under suitable regularity conditions, we show that when ((ref)) holds
We provide sufficient conditions for this convergence to hold in the following result, which relies on combining our previous bounds with a martingale CLT. We require additional assumptions. Define $\hat{A}=\hat{E}_{P}\left[ Y_{t}^{2}X_{t}X_{t}^{\prime } \right] ,$ $\hat{B}=\hat{E}_{P}\left[ \sigma _{t}^{2}X_{t}X_{t}^{\prime } \right] ,$ and $A=B=E\left[ Y_{t}^{2}X_{t}X_{t}^{\prime }\right] ,$ where $ \sigma _{t}^{2}=E[\left. Y_{t}^{2}\right\vert \mathcal{F}_{t-1}]$. }
{ Assumption A9: (i) The parameter space $ \Theta $ is bounded and $\Pr \left( \widehat{\theta }=0\right) =0$; there exists a $\delta >0$ such that (ii) $E\left[ \left\Vert Y_{t}X_{t}\right\Vert ^{2+\delta }\right] <\infty $ and (iii) the following rate conditions hold
In Assumption A9, $\widehat{\theta }$ is a generic estimator. Using Lasso for $\widehat{\theta }$ might be problematic under the null, since it might be the case that $\Pr \left( \widehat{\theta }=0\right) >0$, see, e.g., zhao2006model. We argue that the Ridge estimator ((ref)) is more suitable for this application, as we expect deviations from the MDH to be \textquotedblleft dense\textquotedblright\ rather than \textquotedblleft sparse\textquotedblright\ (many small correlations, rather than large isolated ones). }
{ Under the alternative hypothesis, our previous expansions for $ \beta $-mixing processes apply and under suitable conditions (see Theorem 3.1)
where $\Omega _{a}=4\theta _{0}^{\prime }E[\left( Y_{t}X_{t}-E[Y_{t}X_{t}]\right) \left( Y_{t}X_{t}-E[Y_{t}X_{t}]\right) ^{\prime }]\theta _{0}.$ Therefore, under the alternative hypothesis and from our results
provided $\sqrt{P}\theta _{0}^{\prime }\Sigma \theta _{0}\rightarrow \infty . $ Thus, the proposed out-of-sample test for the MDH rejects for $\hat{t}$ larger than the corresponding critical value from the normal distribution (one-sided test) and it is consistent against the alternatives where $\sqrt{P }\theta _{0}^{\prime }\Sigma \theta _{0}\rightarrow \infty .$ This set includes a large number of alternatives, but it does not include all alternatives. For example, for alternatives where $E[Y_{t}X_{t}]=0$ but $ E[\left. Y_{t}\right\vert \mathcal{F}_{t-1}]\neq 0$, our test is inconsistent. Since $X_{t}$ is high-dimensional, the class of processes for which $E[Y_{t}X_{t}]=0$ but $E[\left. Y_{t}\right\vert \mathcal{F} _{t-1}]\neq 0$ may be of less practical interest, and as a result, our test is expected to have good power properties relative to existing tests that only account for a handful of (linear) covariances. The next section shows the good empirical performance of the new test. }
{ In order to assess the performance of our proposed test for the MDH in Section 5.1, we run simulations under the null and the alternative, and compare it with a testing procedure based on an OLS predictive model (similar to the one proposed by clark2006using) and with the Automatic Portmanteau (AP) test proposed in escanciano2009a. The number of Monte Carlo simulations is 500. We implement our test with a cross-validated Ridge estimator $\widehat{\theta }$ and a vector $X_{t}$ that includes 30 lags, their two by two interactions, their squares, cubes and fourth exponents. We use 50% or 80% of the sample as the training set and 50% or 20% for testing (corresponding to $\pi =1$ and $\pi =0.25$ respectively). To analyze the size of the tests, we fit a GARCH(1,1) model to EUR/USD data obtaining the next DGP: $Y_{t}=\epsilon _{t}\sigma _{t},$ where
and where henceforth $\epsilon _{t}$ follows an iid standard normal distribution. }
{ Table (ref) shows that OLS-based tests and Ridge-based tests have good and similar size for all sample sizes and confidence levels. Also, the dependence on the sample splitting chosen is moderate, and for most cases small.
To assess the power we consider the following DGPs: }
{ The empirical rejection probabilities are reported in Table (ref). For the AR(1)-GARCH(1,1) and EXP(1), the power of the Ridge-based test is larger than the one of the OLS-based test for all sample sizes and confidence levels. As our specified model does not contain Moving Average (MA) regressors, neither of the prediction-based tests have good power against the NLMA alternative. The AP test has excellent power against the first two alternatives, beating the OLS and Ridge based tests. However, for the rest of alternatives, the AP test has low power, consistent with these alternatives presenting serial nonlinear dependence but zero or small autocorrelations. Regarding the dependence of the tests performance on the sample splitting chosen, we see that the power is lower when we choose a smaller $\pi$. This is related with what we see in the previous simulations, as the finite sample bias of the $\Delta$ distribution is larger for $\pi=1$ , increasing the rejection probability of the tests. }
{ The last process has near zero autocovariances but it has structure in the mean in the sense that $Y_{t}$ is correlated with nonlinear functions of its lags. This helps to illustrate two key aspects about the comparison between the AP and our test. First, the AP test has no power against the alternative if the process has zero autocovariances. Second, our test has power against the alternative if the forecast of the process is not zero, which seems to be the case here, see the discussion above about the consistency of our test. }
{
}
{ We apply our predictive testing procedure to two sets of exchange rate data. There is, of course, an extensive empirical literature on the use of machine learning methods for time series predictability, including predictability of exchange rates, see, e.g., plakandaras2015forecasting and references therein. We contribute to this extensive empirical literature with a new out-of-sample predictive tests having justified theoretical guarantees. }
{ As the machine learner, we use cross-validated Ridge with a vector $X_{t}$ including up to 30 lags, their interactions, squares, cubes, and fourth powers, as in the simulations, aiming to have power against a large set of price patterns that may have predictive power. The sample is split into training and testing for $\pi \in \{0.25,1\}$. As we are in a time series setup, the standard cross-validation cannot be used to choose the regularization parameter. Among the different options, we will use blocked cross-validation. This consists in first splitting the sample into $ k $ blocks and then splitting each of them in training and testing. Finally, the mean squared errors of the testing subsamples are averaged. In this case, we split the training sample into 2 blocks ($k=2$). }
{ We compare the results of our prediction-based MDH tests with the Automatic Portmanteau test developed in escanciano2009a, which has been shown to have a good performance in terms of power. As a second benchmark, we compare with the model estimated using OLS, as in clark2006using. There exists a large classical literature on testing the MDH, see, e.g., escanciano2009a, escanciano2009b, including tests that detect nonlinear alternatives, see, e.g., escanciano2006a. The goal of this application is to show if the use of machine learning predictive methods improves upon these classical methods in detecting (possibly nonlinear) dependence in exchange rate data. The previous simulations suggest that our method has the potential to do so even in cases where the process has no serial linear dependence, given that features included in $X_{t}$ may present some correlation with $Y_{t}$ (higher order serial dependence). }
{ The first dataset contains daily increments of bilateral exchange rates obtained as in escanciano2009a from \href{http://www.federalreserve.gov/Releases/h10/hist} {http://www.federalreserve.gov/Releases/h10/hist} going from 16/11/1987 to 16/11/2007 ($T=6000$ observations). We report the empirical rejections for this data in Table (ref). Taking as reference a 5$ \%$ confidence level, none of the tests reject the MDH for the AUD, CAD, DKK, GBP, HKD and JPY . For the HKD, the AP does not reject the null while the OLS and Ridge tests do at $\pi =0.25$ and $\pi =1,$ respectively. This suggests the existence of nonlinear dependence in the price series. }
{
}
{ The second dataset consists of high-frequency data (1 minute) of bilateral exchange rates between 2023-05-15 and 2023-07-02 ($T=6000$ observations), obtained from the Dukascopy database. For the USD/CAD, USD/JPY and EUR/USD, none of the tests reject the null. Regarding the GBP/CAD, all tests reject the null at a 5% confidence level. Interestingly, for the GBP/USD with $\pi =1$ the Ridge-based test rejects the null at 5%, while the AP and OLS tests do not, suggesting the existence of nonlinear dependence detected thanks to the use of machine learning methods. For the GBP/AUD with $\pi =1$, the AP rejects the null at 8% while OLS and Ridge prediction-based tests do not. The last two observations are consistent with our simulation results as prediction-based tests showed lower power than the AP for linear DGPs, and the power was generally larger for Ridge with $\pi =1 $. }
{ Several conclusions emerge from this application. First, inference may be sensitive to sample splitting when using machine learning methods. This can be related to the size of the estimation risk, as explained by our theoretical and simulation results throughout the paper. We documented that for accurate confidence intervals on zero-mean score loss functions, a small value of the out-of-sample to in-sample ratio should be considered (e.g. $\pi =0.25)$ while when using our MDH test, larger values of this ratio (e.g. $\pi =1$) increase the power without significantly affecting the size. We maintain these recommendations on the sample splitting along with a warning about the effect of structural breaks in our methods. Second, the use of machine learning techniques, such as Ridge, seems to bring new information regarding the predictability of some of the exchange rates considered when using large models under the alternative. This suggests the existence of nonlinear dependence in some of the price series analyzed, in contrast with the lack of serial linear dependence that traditional correlation-based tests suggest for all the exchange rates considered except the GBP/CAD at 1-minute frequency. Given these results, we advocate for the complementary use of the AP test and our MDH test with large models estimated by Ridge using a not very small sample splitting ratio (e.g. $\pi =1$). }
{ The paper shows that to obtain standard asymptotic theory in out-of-sample analysis with machine learning methods two key properties must be satisfied simultaneously: (i) a zero-mean condition for the score of the prediction loss function; and (ii) a fast rate on the machine learner. We have documented theoretically and by simulations these points. We have also found sufficient primitive conditions for $\beta $-mixing and $\alpha $-mixing time series building on recent work by wong2020lasso and kengne2024deep. We have illustrated the applicability of our results with three different applications using different loss functions and machine learners. }
{ There are several interesting venues for further research related to our results. First, the investigation of cases where the score of the loss function does not have a zero-mean. For example, for the absolute mean error loss function, the score does not have a zero-mean with an asymmetric error distribution in general. We will investigate ways to transform the loss function so that standard inference applies. A second interesting question is the (adaptive) choice of the sample splitting. At the moment, we can only offer a simple recommendation based on our theoretical and simulation results. For accurate confidence intervals with machine learning, a small value of $\pi $ such as $ \pi =0.25$ is recommended, while for MDH testing a larger value such as $\pi =1$ is generally preferred. These two problems are beyond the scope of this paper, and will be investigated in future research. }
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}