# Enhancing Weather Forecasting Integrating LSTM and GA
## 4 Results and Discussion
### Forecasting with Regression Models  
The linear relation between the two sites was analyzed for each of the variables in the time interval common to both sets of data, i.e., between 8 September and 30 December 2022. To take advantage of the regression techniques described in Section 3, a combined model was developed to predict missing data. The measurements recorded at Quinta de Santa Barbara were used as dependent variables, while those from Pinhao were considered as independent variables. Figure 3 shows the scatter plots of the observed values (blue dots) and the trend line that fits the data. For the daily average temperature (\(FF_{MED}\)), the values observed in the two locations have a strong linear relation. In turn, for the other variables, the observed values are dispersed around the trend line, which also shows that the proposed model is capable of making accurate predictions for these variables. However, in order to verify whether the MLR model fits the dataset, we evaluated the \(R^{2}\) values and its residuals. Table 1 shows the \(R^{2}\) values for each of the variables under study. Analyzing the \(R^{2}\) values, it can be seen that they are relatively high for all the variables except the daily wind direction (\(DD_{MED}\)), which had a value less than 0.5. Figure 3: Linear relationship between the values observed in Pinhão and Quinta de Santa Barbara: (**a**) daily average temperature, (**b**) daily wind direction, (**c**) daily average wind speed, (**d**) daily instantaneous wind speed, and (**e**) daily solar radiation. Having these results, the \(p\)-values of the coefficients were analyzed to determine whether a given independent variable had a significant effect on the dependent variables. Therefore, the \(p\)-values were analyzed for each of the dependent variables and the coefficients that did not meet the condition \((P>|t|)<0.05\) were excluded. Once the coefficients \begin{table}
\begin{tabular}{l l l} \hline
**Variable** & **Description** & \(\mathbf{R^{2}}\) \\ \hline T\_MED & Daily average temperature & 0.999 \\ DD\_MED & Daily wind direction & 0.477 \\ FF\_MED & Daily average wind speed & 0.821 \\ FF\_MAX & Daily instantaneous wind speed & 0.686 \\ RG\_TOT & Daily solar radiation & 0.754 \\ \hline \end{tabular}
\end{table} 
Table 1: \(R^{2}\) values for each dependent variable studied. Figure 4: Graphical representation of MLR residuals: (**a**) daily average temperature, (**b**) daily wind direction, (**c**) daily average wind speed, (**d**) daily instantaneous wind speed, and (**e**) daily solar radiation. had been excluded, the best regression method for predicting each variable was chosen from among the MLR, ridge, and LASSO methods. Table 1 also shows the values of the coefficients of determination (\(R^{2}\)) for the new regression methods chosen. Table 2 shows the method used for each variable, as well as the coefficients used to calculate the values corresponding to each variable between 2010 and 2022 in Quinta de Santa Barbara. It can also be seen that the dependent variables do not depend on all the independent variables. This means that for each variable to be calculated, the methods select the variables that are highly correlated with the variable to be determined. Finally, using the coefficients provided in Table 2, the mathematical models to calculate the predicted daily values for each variable are given by Equations (12)-(16).