# A Deep Learning Approach for Short-Term Electricity Demand Forecasting: Analysis of Thailand Data
## 6 Results and Analysis
### Parameters Tuning for Scenario 3  
The electricity demand for the year 2018 is forecasted utilizing the refined parameters illustrated in Table 8 with a dataset size of 34,656 and a test size of 5664. Compared to the other two RNN-GRU and RNN models, the RNN-LSTM model performed better. We achieved the lowest minimum loss of validation (MAE) of 222.07 MW compared to 229.89 MW and 230.57 MW using the RNN-LSTM simulation setup.  
In Scenario 3, as stated in Table 8, we were able to attain the following outcomes:  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameters** & **LSTM** & **GRU** & **RNN** \\ \hline Number of hidden layers & 1 & 1 & 2 \\ Number of nodes & 128 & 64 & 64 \\ Epochs & 57 & 61 & 51 \\ Batch size & 48 & 48 & 48 \\ Look back period & 5 days & 8 days & 8 days \\ Dropout & 0.15 & 0.15 & 0.2 \\ Time period & 48 & 48 & 48 \\ Validation loss (MAE) & 189.87 & 179 & 195.11 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Set of parameters for lowest validation loss of Scenario 2.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **Nodes** & **Layers** & **Dropout** & **Lookback Period** & **Epochs** & **Test MAE** & **Test MAPE (\%)** \\ \hline LSTM & 128 & 1 & 0.15 & 5 days & 57 & 191.57 & 1.92 \\ GRU & 64 & 1 & 0.15 & 8 days & 61 & 181.63 & 1.89 \\ RNN & 64 & 2 & 0.2 & 8 days & 51 & 201.35 & 1.98 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Implementing the optimal parameter settings for day-ahead forecasting using the test dataset of Scenario 2.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameters** & **LSTM** & **GRU** & **RNN** \\ \hline Number of hidden layers & 1 & 2 & 1 \\ Number of nodes & 128 & 64 & 128 \\ Epochs & 72 & 81 & 69 \\ Batch size & 48 & 48 & 48 \\ Look back period & 8 days & 8 days & 5 days \\ Dropout & 0.1 & 0 & 0.1 \\ Time period & 48 & 48 & 48 \\ Validation loss (MAE) & 222.07 & 229.89 & 230.57 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Set of parameters for lowest validation loss of Scenario 3.  
* The LSTM model with nodes = 128, layers = 1, dropout = 0.1, lookback period = 8 days, and epochs = 72 produced the minimal validation loss of 222.07 MW which was the lowest loss across all three models.
* The GRU model with nodes = 64, layers = 2, dropout = 0, lookback period = 8 days, and epochs = 81 obtained the minimal validation loss of 229.89 MW.
* The RNN model with nodes = 128, layers = 1, dropout = 0.1, lookback period = 5 days, and epochs = 69 achieved the minimal validation loss of 230.57 MW, which was the highest loss across all three models.  
When optimized hyperparameters are used, Table 9 shows that the RNN-LSTM model achieved its best performance in terms of both performance metrics (MAE and MAPE) with MAE = 226.76 MW and MAPE = 2.13%.  
The results of RNN-LSTM, RNN-GRU, and RNN are presented in Figures 12-14, respectively, for Scenario 2 (result of alternative months). In each plot, the actual demand is represented as \"Actual\", while the forecasted results are indicated by their respective model names, such as LSTM, GRU, and RNN. From Figures 12-14, it is evident that the RNN-GRU model performed the best among all three models in terms of prediction accuracy. Specifically, in the case of the RNN-GRU model depicted in Figure 13, there is underestimation in March, May, and July, while January, September, and November exhibit overestimation. Additionally, the results of all three scenarios using all three models are detailed in Appendices A and B.