## 2 Background  
### Functional Temporal Regression  
Regression analysis is a method that allows us to predict a numerical outcome variable based on the value of one (univariate regression) or multiple (multivariate regression) predictor variables. The most basic approach to multivariate regression is a linear regression algorithm, typically based on a least squares method. Linear regression assumes that the underlying phenomenon can be approximated with a straight line (or a hyperplane, in the multivariate case). However, in the general case, a functional regression algorithm searches for a generic function to approximate the values of the dependent variable. Assume that \(\mathcal{A}\) is a data set with \(n\) independent variables \(A_{1},\ldots,A_{n}\) and one observed variable \(B\), where \(Dom(A)\) (resp., \(Dom(B)\)) is the set in which an independent variable (or attribute) \(A\) (resp., the dependent variable \(B\)) takes a value, and \(dom(A)\) (resp., \(dom(B)\)) is the set of its actual values of \(A\) (resp., \(B\)):  
\[ \begin{bmatrix}a_{1,1}&a_{1,2}&\ldots&a_{1,n}&b_{1}\\ a_{2,1}&a_{2,2}&\ldots&a_{2,n}&b_{2}\\ \cdots&\cdots&\cdots&\cdots&\cdots\\ a_{m,1}&a_{m,2}&\ldots&a_{m,n}&b_{m}\end{bmatrix}  \tag{1}\]  
Then, solving a functional regression problem consists of finding a function \(F\) so that the equation:  
\[B=F(A_{1},A_{2},\ldots,A_{n}), \tag{2}\]  
is satisfied. When we are dealing with a multivariate time series, composed of \(n\) independent and one dependent time series, then data are temporally ordered and associated with a timestamp:  
\[ \begin{bmatrix}a_{1,1}&a_{1,2}&\ldots&a_{1,n}&b_{1}&t_{1}\\ a_{2,1}&a_{2,2}&\ldots&a_{2,n}&b_{2}&t_{2}\\ \cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\ a_{m,1}&a_{m,2}&\ldots&a_{m,n}&b_{m}&t_{m}\end{bmatrix}  \tag{3}\]  
and solving a temporal functional regression problem consists of finding a function \(F\) so that the equation:  
\[B(t)=F(A_{1}(t),A_{2}(t),\ldots,A_{n}(t)) \tag{4}\]  
is satisfied for every \(t\). Temporal regression is different from the non-temporal one when, in identifying the function \(F\), one takes into account the past values of the independent variables as well. Having fixed a maximum lag \(l\), the equation becomes:  
\[B(t)=F(A_{1}(t),A_{1}(t-1),\ldots,A_{1}(t-l+1),\ldots,A_{n}(t),A_{n}(t-1), \ldots,A_{n}(t-l+1)) \tag{5}\]The literature on functional regression is very wide. Methods range from linear regression, to polynomial regression, to generic non-linear regression and include variants of the least squares method(s), such as robust regression [21; 22]. Autoregressive models, typically of the ARIMAX [23] family, are methods that include, implicitly, the use of past values of the independent variables and, in the most general case, of the dependent one as well (therefore, modifying Equation (5) to include \(B(t-1),B(t-2),\ldots,B(t-l+1)\) as well; as a matter of fact, the simplest autoregressive models are based on the past values of the dependent variable only). The machine learning counterpart approach to temporal functional regression and, in fact, to temporal regression as a whole consists of using a non-temporal regression algorithm fed with new variables, that is lagged variables, that corresponds to the past values of the variables of the problem. In other words, the typical strategy consists of producing a lagged data set from the original one:  
\[ \begin{bmatrix}a_{l,1}&a_{l-1,1}&a_{l-2,1}&\ldots&a_{l,n}&a_{l-1,n}&a_{l-2,n}& \ldots&b_{l}&t_{l}\\ a_{l+1,1}&a_{l,1}&a_{l-1,1}&\ldots&a_{l+1,n}&a_{l,n}&a_{l-1,n}&\ldots&b_{l+1}&t_ {l+1}\\ \ldots&\ldots&\ldots&\ldots&\ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\ a_{m,1}&a_{m-1,1}&a_{m-2,1}&\ldots&a_{m,n}&a_{m-1,n}&a_{m-2,n}&\ldots&b_{m}&t _{m}\end{bmatrix}  \tag{6}\]  
Such a strategy has the advantage of being applicable to every regression algorithm, up to and including the classic functional regression algorithm, but also, symbolic algorithms for regression.