## 4 Application
### Generalized Additive Model (GAM)  
Using the information of simulated data through the alpha stable distribution, the estimation of a generalized additive model was carried out, which will take as a dependent variable the demand for electric energy, and as explanatory variables, the price of energy (local marginal price) and fuel prices (fuel oil) for a sample of data is used with weekly data for 52 weeks [49]. The model estimated is presented in Equation (26):  
\[X_{i}=\theta_{0}+S_{1}(LMP_{i})+S_{2}(PCOMB_{i})+\varepsilon_{i},\;i=1,\;\ldots, \tag{26}\]  
where  
* \(X_{i}\) is the demand for the period \(i\). * \(LMP_{i}\) is the Local Marginal Price for the period \(i\). * \(PCOMB_{i}\) is Fuel Oil Price for the period \(i\). * \(S_{j}\) are smoothing splines functions for each parameter, \(j=1,\;2\). The results of the GAM model show that smoothing splines are statistically significant for non-parametric estimates, so there are non-linear relationships between the variables associated with these functions and the dependent variable. Table 2 shows the estimated parameters for the generalized additive model, which uses demand as a dependent variable, a variable that is constructed through the  
Figure 5: Alpha parameter effect (IEE-104). simulation of instances based on the three base systems used (IEEE-104, IEEE-24, and IEEE-18) and the sample of data on LMP and fuel prices (PCOMB) for 52 weeks. The benefit of using GAM models is that the non-linear effect of each independent variable can be modeled separately, keeping the rest constant and assessing the additive effect of all explanatory variables and can include as many explanatory variables as want to evaluate. Figure 6 shows the non-linear relationship fitted by the smoothing spline function in the estimated additive model for LMP and PCOMB variables. The estimates with the proposed generalized additive model show an adequate fit to the observed behavior of the demand for electrical energy. To compare the results of the non-linear fit of the behavior of the demand for electrical energy, the coefficient of determination was estimated \((R^{2}=1-\frac{\mathrm{SSE}}{\mathrm{SST}})\). In addition, three non-linear models were compared: (a) GAM, (b) local regression, and (c) polynomial regression. Figure 7 shows the coefficient of determination \((R^{2})\) for the three compared non-linear fitting methods. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**ANOVA for Parametric Effects** & **Df** & **F-Value** & **Pr (>F)** & **Parameter** \\ \hline S(LMP) & \(1\) & 57.4724 & 0.00000 & \\ S(PCOMB) & \(1\) & 2.4594 & 0.12330 & \\ Residuals & 49 & & & \\ \hline
**ANOVA for Nonparametric Effects** & **NPar Df** & **Npar F** & **Pr (F)** & \\ \hline Intercept & & & & 4320.1975 \\ S(LMP) & 3 & 3.6108 & 0.01958 & 0.3957 \\ S(PCOMB) & 3 & 9.3544 & 0.00005 & 2.9405 \\ \hline \hline \end{tabular}  
* Null deviance: 13,492,752 on 57 degrees of freedom. Residual deviance: 3,607,220 on 49.0003 degrees of freedom.
* AIC: 824.8005.  
\end{table} 
Table 2: Generalized additive model (GAM) parameter estimations. Figure 6: Smoothing spline functions (fitted function and pointwise standard errors). The results of the coefficient of determination show that while the local regression model and the polynomial model share a similar \(R^{2}\), the GAM model shows the best result \((R^{2}=0.8344)\). With GAM fitted, it is possible to simulate complete periods of demand for the test cases. Figure 8 shows 10 simulations (only 10 for graphic reasons) of the cases. It can be seen that when simulating the data with the final GAM fitted, seasonal behavior is maintained as well as peaks in demand. The methodological proposal shows that by combining the simulation of alpha stable variables and fitting a generalized additive model, it is possible to generate as many cases data as is required for  
Figure 8: Weekly electricity demand simulations with GAM. Figure 7: \(R^{2}\) for the three non-linear models. an electrical system.