# Simulating Intraday Electricity Consumption with ForGAN
## 4 Results: ForGAN in Action  
ForGAN is applied to the 2015-2018 electricity consumption dataset: parameters are calibrated, validated, and used to generate additional time series, and the performance of ForGAN is evaluated. In total, there are 140,257 data points. In total, 50% of the data (the first 730 days) are used for training the model. The following 10% (approximately 146 days) are used for validation, and the final 40% are used for testing. Validation is mainly used to make a decision about the number of iterations to solve the min-max problem corresponding to ForGAN. More precisely, after a certain number of iterations, the currently optimal parameters \(\theta_{G}\) are used to generate a path of electricity consumption on the time interval corresponding to the one of the validation set. This generated path is then compared with the validation data (i.e., the actual electricity consumption time series), and quality is assessed visually and through additional measures (see below) to determine whether the generated time series path could be a true one. Once the generated series is deemed satisfactory, the training process is stopped. However, to ensure stability in the parameter estimation sequence, 1000 iterations are ultimately used. Figure 9 shows the first generated path during the validation process (in blue) together with the times series from the validation set (in red). Obviously, there is room for improvement. Figure 10 shows the last one (in blue) with the final parameter values after 1000 iterations. Indeed, this one follows the actual path (in red) very accurately but is also not identical. The differences that are still visible are a consequence of the randomness in both the red and blue paths. It is important to emphasize that the goal is to learn the conditional distributions of the next value and not to make a perfect prediction. After having succeeded with implementation and calibration, **it is mandatory to perform more quality checks** before ForGan can be used for simulation purposes. The first check is carried out to compute some error and similarity measures. The root mean squared error (RMSE), mean absolute error (MAE) and mean absolute percentage error (MAPE) are calculated based on the error between the predicted and actual values. This is completed by running the generator 100 times over the test set and averaging the values for each run. From this, the mean and standard deviation of these error measures are obtained, as reported in Table 1. For additionally judging how close the distribution of the generated data is to the distribution of the values in the test set, the Kullback-Leibler divergence (KLD) and the continuous ranked probability score (CRPS) are also calculated. Notably, a very low KLD value of 0.007154 is obtained, indicating that the distributions of the test data and the generated data are indeed very close. Also, the small values of the other measures in Table 1 indicate that ForGAN performs well. The evaluation plot presented in Figure 11 shows the model's performance, which is very good. The generated data's probability distribution for one-step-ahead forecasts captures the original distribution pattern very well when compared to the test dataset. Notably, a bi-modal distribution is present. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Metric** & **Value** & **Std Dev** \\ \hline RMSE & 0.0526 & 0.000464 \\ MAE & 0.0044 & 0.000532 \\ MAPE & 0.00073 & 0.0041 \\ CRPS & 0.0044 & - \\ KLD & 0.0072 & - \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Error metrics used to judge the closeness of the distributions of the 15 min electricity consumption of generated data and the corresponding distribution of the test data. Figure 10: The validation set and the generated time series based on the GAN parameters after the last step of the parameter iteration. Figure 9: The validation set and the generated time series based on the GAN parameters after the first step of the parameter iteration.