## 2 Methodology and Data
### Proposed Forecasting Framework
#### 2.1.3 Determining the Support Vector Regression (SVR)  
Furthermore, this paper incorporates SVR as a crucial component. SVR is a popular ML algorithm widely employed in regression tasks. It transforms the nonlinear relationship between input vectors and corresponding real responses into a linear relationship in a higher-dimensional feature space through an unknown function. The objective is to find a relation represented by Equation (3):  
\[\mathcal{P}=\{(u_{i},v_{i})\in\mathbb{R}^{n}\times\mathbb{R}\quad\text{with} \quad i=1,...,N\}, \tag{3}\]  
where \(u_{i}\) denotes the input vectors and \(v_{i}\) represents the corresponding real responses. The main idea of this ML technique is to transform the nonlinear relationship between \(u_{i}\) and \(v_{i}\) into a linear relationship in a higher-dimensional feature space using the unknown function \(\psi:\mathbb{R}^{n}\longrightarrow\mathcal{F}\subset\mathbb{R}^{n+k}\), by looking for a relation such as (4)  
\[\widehat{v_{i}}=g(u_{i})=w^{\prime}_{sv}\psi(u_{i})+b, \tag{4}\]  
where \(w_{sv}\in\mathbb{R}^{n+k}\) is the vector of weights and \(b\in\mathbb{R}\) is a constant. To optimize the weights, the expresion (5) needs to be minimized  
\[\min_{w_{sv},\xi_{i}^{*},\xi_{i}^{*}} \frac{1}{2}||w_{sv}||^{2}+C\sum_{i=1}^{N}(\xi_{i}+\xi_{i}^{*}) \quad\text{subject to}\quad\left\{\begin{aligned} \widehat{v_{i}}-v_{i}\leq \epsilon+\xi_{i},\\ v_{i}-\widehat{v_{i}}\leq\epsilon+\xi_{i}^{*},\end{aligned}\right. \tag{5}\]  
where \(\epsilon,C>0\) are constants and \(\xi_{i},\xi_{i}^{*}\geq 0\) are slack variables, thus turning the problem into a quadratic programming problem, applying the method of Lagrange multipliers and simplifying the expression (5) to (6).  
\[\min_{\alpha,\alpha^{*}} \frac{1}{2}\sum_{i=1}^{N}\sum_{j=1}^{N}(\alpha_{i}-\alpha_{i}^{* })\Big{(}\alpha_{j}-\alpha_{j}^{*}\Big{)}k(u_{i},u_{j})+\sum_{i=1}^{N}(\alpha_ {i}-\alpha_{i}^{*})v_{i}+\sum_{i=1}^{N}(\alpha_{i}+\alpha_{i}^{*})\epsilon,\] (6) subject to conditions \[\left\{\begin{aligned} \sum_{i=1}^{N}(\alpha_{i}-\alpha_{i}^{*})=0,\\ 0\leq\alpha_{i},\alpha_{i}^{*}\leq C,\end{aligned}\right. \tag{7}\]  
The function \(k\) that appears in (6) is called the kernel function and is used as an approximation of the scalar product of the function \(\psi\) with itself, so we consider \(k(u_{i},u_{j})=\psi(u_{i})^{\prime}\psi(u_{j})\). Meanwhile, the values \(\alpha_{i},\alpha_{i}^{*}\) are known as Lagrange multipliers, and their linear combination such that \((\alpha_{j}-\alpha_{j}^{*})=0\) are called support vectors. Solvingthe resulting quadratic programming problem based on Lagrange multipliers (6) and (7) and substituting in (4), the weights \(w_{svr}\in\mathbb{R}^{n+k}\) and constant \(b\in\mathbb{R}\) can be optimized. The prediction expression derived from this process is provided in Equation (8):  
\[\widehat{v}_{i}=g(u_{i})=\sum_{j=1}^{N}(\alpha_{j}-\alpha_{j}^{*})k(u_{j},u_{i} )+b. \tag{8}\]  
In our approach, SVRs are employed as predictors of the error time series generated by the NAR network on the observed variable, allowing us to correct the network's predictions. Specifically, the Gaussian kernel function \(k(u_{i},u_{j})=e^{\gamma||u_{i}-u_{j}||^{2}}\) is utilized, with \(\epsilon\), \(C\) and \(\gamma\) automatically determined using the SVM function of the R package \(e1071\). Additionally, the number of inputs utilized as input variables is determined through model comparisons on the training set in which \(n\in[1,20]\cap\mathbb{N}\).