**4. Results and Discussion**

The training and texting process is shown in Figure 7. Loss function with 500 epochs, batch size of 256 was used for this ANN model.

**Figure 7.** Loss function with 500 epochs for ANN model, batch size of 256.

As shown in Figure 7, the minimum training MSE and minimum testing MSE were 0.0762 and 0.0775, respectively, for the ANN model. The optimum parameters selected for the ANN model were batch size 256 and learning rate 0.01.

Figure 8 shows the graph of training and texting of data with the LSTM model for 500 epochs.

**Figure 8.** The graph of training and testing of data with LSTM model for 500 epochs.

As demonstrated in Figure 8 for the LSTM model, the minimum training MSE and minimum testing MSE were 0.0049 and 0.0080, respectively. The optimum parameters selected for the ANN model were batch size 256 and past days of 15 h.

Table 6 compares the results obtained by using the ANN model and the LSTM model. Using MSE to calculate the error/loss of the two models, it was found that LSTM improves the results about 18 times in case of training, and about 9 times in case of testing. Since LSTM successfully outperformed ANN by utilizing the data from the previous 15 h, LSTM was the chosen model to test on the 4th year testing data.


**Table 6.** Error comparison of models after 500 epochs.

Figure 9 shows a sample of the prediction performed using the LSTM trained model on 175 days of the 4th year assigned for testing the trained model. Number of days are shown on the horizontal axis versus the normalized solar radiation on the vertical axis. We calculated the coefficient of determination, R2, along with the MSE for the testing results. R2 was found to be 0.9365 and MSE was 0.01. In order to demonstrate the significance of our results, we compared our results to similar work in the literature by M. Mishra et al. [37] and U. Agbulut et al. [60]. Moreover, U. Agbulut et al. [60] predicted the solar radiation by using deep learning models for four different cities in Turkey. We averaged the values of their metric scores over the four cities to compare with ours. On the other hand, M. Mishra et al. [37] utilized wavelet transformation on the historical PV solar output at the University of Illinois in Urbana Champaign along with the meteorological data to train LSTM model to perform daily predictions. The authors compared the performance of different ML models to LSTM. Similar to our findings, LSTM outperformed the other models. They trained the models using 18 months of data and tested with one month. It is worth noting that they were performing hourly predictions for 1 day ahead.

**Figure 9.** Radiation of 175 days (testing days) as LSTM predicted (blue) versus the ground truth as measured (red).

Table 7 demonstrates the performance of our model with respect to other similar models in the literature. Although we outperformed the other models in terms of R2, M. Mishra et al. [37] achieved better results in terms of RMSE and MAE. We claim that this higher performance is due to the fact that they performed hourly prediction of the one day ahead and not the whole day. Moreover, we tested on a whole year of data and not only one month.


