## 3 PV Generation Forecaster Models
### Artificial Intelligence Models
#### 3.2.3 Support Vector Regression  
SVM is a supervised machine learning method for function estimation [26]. SVM is mostly used in classification problems but is suitable for regression tasks as well. A version of SVM for regression is referred to as SVR. Suppose that we are given training data \(\{(x_{1},\ y_{1}),...,(x_{l},\ y_{l})\}\), where \(l\) is the number of samples in the training set, \(x_{i}\in R^{n}\) is an input vector, and, \(y_{i}\in R\) is the corresponding target value. In SVR, the basic idea is to map the \(x\) into a high dimensional feature space \(\mathcal{F}\) via a non-linear mapping function and do linear regression in this space. Thus, the linear regression in a high dimensional (feature) space corresponds to non-linear regression in a low dimensional input space [27]. SVR approximates the regression function as follows:  
\[f(x)=\langle\omega,\ \Phi(x)\rangle+b, \tag{5}\]  
where \(\langle\cdot,\cdot\rangle\) denotes the dot product in \(\mathcal{F}\), \(\omega\) is a vector of weight coefficients, \(\Phi(x)\) is the non-linear mapping function, and \(b\) denotes the bias constant. The common formulation of SVR is Vapnik's \(\varepsilon\)-SVR. In \(\varepsilon\)-SVR the goal is to find the \(f(x)\) that has at most \(\varepsilon\) deviation from the actual targets \(y_{i}\) for all the training data. We can write this problem as a convex optimization problem where the coefficients \(\omega\) and \(b\) can be obtained by the following formula:  
\[\text{minimise}:\ \frac{1}{2}\|\ \omega\ \|^{2}+C\sum_{i=1}^{l}\xi_{i}+\xi_{i}^{*}, \text{subject to}: \begin{cases}y_{i}-\omega,\ \Phi(x_{i})-b\leq\varepsilon+\xi_{i}\\ \omega,\ \Phi(x_{i})+b-y_{i}\leq\varepsilon+\xi_{i}^{*}\,,\\ \xi_{i},\ \xi_{i}^{*}\geq 0\end{cases}  \tag{6}\]  
where \(\xi_{i}\) and \(\xi_{i}^{*}\) are slack variables, the constant \(C\) determines the amount up to which deviations larger than \(\varepsilon\) are tolerated, and \(\varepsilon\) is the margin of tolerance. This optimization problem (6) is a quadratic programming type, and in most cases, the problem can be solved more easily in its dual formulation [28]. In the case of \(\varepsilon\)-SVR the support vectors are training samples that lie on the \(\varepsilon\)-tube bounding decision surface, as illustrated in Figure 7.  
As noted in the previous definitions, the algorithm only depends on dot products between vectors \(x_{i}\). Because of this is enough to know \(k(x,x\ )=\langle\Phi(x),\ \Phi(x^{\prime})\rangle\) rather than \(\Phi\) explicitly. \(k(x,x^{\prime})\) is known as the kernel function of the SVR model. The radial basis function (RBF) kernel is used in this study, expressed as:  
\[k\big{(}x,x^{\prime}\big{)}=e^{-\gamma\|x-x^{\prime}\|^{2}}, \tag{7}\]  
where \(\gamma\) defines the influence of the support vectors selected by the model. To summarize the models, the following lines present the advantages and disadvantages of each of them. Starting with the analytical model, as mentioned above, one of the main disadvantages of the model is that it is difficult to obtain the mathematical definition that describes the system to be modeled. For the same reason, it is necessary to have a high level of knowledge of the physical functioning of the system to be simulated. On the other hand, at the same time, by having a high level of knowledge, it is more likely that all the aspects involved in  
Figure 6: (**a**) Open (series-parallel) mode of NARX; (**b**) Closed (parallel) mode of NARX. the system will be considered. Furthermore, obtaining a generic model that provides good results under different conditions. As for the ML-type models, the main characteristic that differentiates them from the analytical model is that it is not necessary to have a detailed knowledge of the operation of the system to be modeled. One of the major advantages of SVR is that it can obtain good results with a small dataset [30], so it is not necessary to have a large training set.