I'd like to know how to use cross-validation for time series analysis using a regression-based approach without incurring in under- or over-fitting. In particular, assume we have an input time series $u$ and an output time series $y$, both of size $n$. Also assume that we want to obtain a regression model of the form ${ y }_{ t }={ \alpha }_{ 1 }{ y }_{ t-1 }+{ \alpha }_{ 2 }{ y }_{ t-2 }+{ \alpha }_{ 3 }{ u }_{ t-5 }+{ e }_{ t }$. Therefore we build a system of equations of the form $Ax=b$, where:
$A=\begin{bmatrix} { y }_{ 5 } & { y }_{ 4 } & { u }_{ 1 } \\ { y }_{ 6 } & { y }_{ 5 } & { u }_{ 2 } \\ \vdots & \vdots & \vdots \\ { y }_{ n-1 } & { y }_{ n-2 } & { u }_{ n-5 } \end{bmatrix}$ $b=\begin{bmatrix} { y }_{ 6 } \\ { y }_{ 7 } \\ \vdots \\ { y }_{ n } \end{bmatrix}$ $x=\begin{bmatrix} { \alpha }_{ 1 } \\ { \alpha }_{ 2 } \\ { \alpha }_{ 3 } \end{bmatrix}$
How should I split the data into training and testing sets for cross-validation given the high dependency within the data?