## 3 Results
### Test Case 2: Load Forecasting  
To train and validate the LRNN employed for load forecasting, active power consumption data provided by the Commission for Energy Regulation (CER) [27] have been utilized. This dataset contains half-hourly energy consumption records collected from smart meters (SMs) installed in 6445 customers' premises as part of the Electricity Smart Metering Customer Behavior Trials [28]. The data, gathered over an 18-month period (from 14 July 2009 to 31 December 2010) from various distribution network locations in Ireland, represent different customer categories, including residential users, small and medium enterprises (SMEs), and others. In this study, the model has been applied to forecast the power demand of residential loads. The same dataset has been used in [26], where a multilayer perceptron (MLP) NN has been trained to predict power demand one step ahead at each medium-voltage node with limited error, using both exogenous and historical measurements. The dataset consists of approximately 25,000 data points (Figure 7), of which the first 2000 have been used for network training. As can be observed from Figure 7, there is a higher energy demand during the summer period and a lower demand during the winter period. In Figure 8, the energy demand over a week of data acquisition is shown. The observed trend exhibits a repetitive pattern, indicating a periodic variation in energy consumption. This periodicity suggests a consistent demand cycle, likely influenced by daily or operational routines. The data points, represented by markers, highlight fluctuations in power demand. Figure 6: Prediction error of the state variable X during the adaptation of the NN. The optimized neural network adopts a 1-10-1 architecture (\(K=10\)), with six delays (\(r=6\)) for each hidden neuron and no delay in the output neuron. After about 40 iterations, the MSE decreases, reaching a value of approximately \(10^{-7}\). To compare the performance of the LRNN model, with the MLP in [26], the Mean Absolute Error (MAE), defined as in the following, has been used:  
\[MAE=\frac{1}{n}\sum_{i=0}^{n}\lvert o_{i}-\delta_{i}\rvert \tag{28}\]  
where \(o_{i}\) is the actual load value, \(\delta_{i}\) is the corresponding predicted load value, and \(n\) is the number of training or test samples. The forecasting performance is better when the MAE values are smaller. Table 1 presents a comparison of the performance achieved using the proposed LRNN and the one implemented in [26]. As can be noted, the MLP model achieves lower error during training but exhibits a higher test error, suggesting potential overfitting. In contrast, the LRNN has a slightly higher training error but a lower test error, indicating better generalization. Figure 8: Power demand over a week of data acquisition. Figure 7: Trend of residential load \(res_{1}\), over a period of 18 months (from 14 July 2009 to 31 December 2010), obtained by aggregating the energy consumption of 523 residential loads randomly chosen. Finally, in Figure 9, two plots illustrating the results of the load forecasting model implemented using the LRNN trained with the proposed algorithm are reported. The upper plot presents the power demand over a dataset of 8000 samples. A vertical dashed line separates the training and test phases, with the training set comprising the first 2000 samples and the test set extending beyond this point. The model successfully captures the underlying periodic patterns of the power demand, though some high-frequency variations appear more pronounced in the target data. The lower plot, labeled as the last 400 samples, focuses on the final segment of this portion of the dataset, providing a detailed comparison of the target and output values. The predicted values closely follow the actual power demand, with minimal deviation, indicating a high level of accuracy in the model's forecasting capability.