Electricity energy consumption forecasting using LSTM and NAR
* Author to whom correspondence should be addressed.
Sigma Journal of Engineering and Natural Sciences 2026, Vol. 44, Issue 1, pp. 153-161; doi.org/10.14744/sigma.2025.00056
Abstract
Keywords: Energy Consumption; Deep Neural Network; LSTM; NAR Neural Network; Time Series Analysis; Forecasting; Energy Efficiency; Long Short-term Memory; Nonlinear Autoregressive
Introduction
Global electricity consumption has been raised rapidly because of population growth and technology development [1], the energy management system (EMS) has gained importance to reduce waste of energy and energy overconsumption. Energy consumption forecasting has an important role in EMS [2,3] and accurate prediction is essential to achieve energy efficiency. So far different type of techniques have been proposed as predictive model to forecast the future behavior of the system, Statistical approach such as SARIMA, ARMA, DLM, Holt–Winters, artificial neural networks including multilayer perceptron [4], physical models and also hybrid techniques. Machine learning (ML) as data-driven models has been realized the most accurate technique to obtain acceptable output in forecasting [5-7]. expresses artificial neural networks have perfect performance if there is sufficient data to train the models. Recently, researchers have been attracted to deep learning networks because of their ability to receive and analyze data when they follow complex non-linear patterns and have a large volume [8,9]. Deep learning has provided significant progress in energy forecasting. These networks have created more innovative research opportunities that increase prediction accuracy [10]. Convolutional neural network with deep structure is presented in [11], which has been able to improve the electricity consumption estimation compared to the seasonal ARIMAX method. The results show that the accuracy of the deep neural network is higher than the ARIMAX. Another study shows the Solar radiation forecasting by using deep neural networks (ARIMAX method) in Eskisehir, Türkiye [12]. A hybrid LSTM model integrated with a stationary wavelet transform (SWT) has demonstrated efficacy in rectifying abnormalities in home energy use, hence enhancing forecast precision in both the short and long term [13]. Another study comparing LSTM, GRU, and Drop-GRU models revealed that LSTM excels above the other models in handling long-term dependencies and nonlinearities in energy data [14]. The integration of CNN with LSTM improves prediction by effectively capturing both geographical and temporal data, as evidenced in a study on multivariate energy use [15]. The efficacy of LSTM in time series analysis was demonstrated in a study that investigated data quality and hyperparameter optimization, highlighting the significance of preprocessing for precision [16,17] Indicates comparison of LSTM neural network and ARIMA for energy consumption forecasting. The result expresses this network is more accurate than statistical estimation methods such as ARIMA. Also, LSTM neural networks are more accurate than non-deep artificial neural networks for prediction. Overfitting may occur during the training process by adding layers in LSTM neural networks. This problem is a challenge in deep neural networks. In fact, if the number of layers increases regardless of the evaluation step error,
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026
the prediction error will increase. The over-fitting issue could be solved by increasing data diversity and volume [18]. In conclusion, LSTM and its derivatives exhibit significant adaptability to various prediction tasks, offering solid solutions for dynamic energy systems. The results illustrate the capability of sophisticated machine learning algorithms to tackle issues in energy consumption predictions with significant accuracy and generalizability. In this research, long-term electrical energy consumption is forecasted by LSTM and NAR neural networks using MATLAB software. Monthly energy consumption data from 1973-2022 in USA was used as the data set and the accuracy of the implemented networks was compared. There were different types of studies like the work of this paper. For example, in [19] the LSTM and NAR were used to forecast monthly smoothed sunspot number time series. In [20], The LSTM and NAR have been used to predict the wind turbine’s generated power. Also, in [21] the LSTM and NAR are designed and compared to find the most accurate solution to forecast daily water consumption. This paper consists of the following sections: The predictive models were presented in Section 2. In Section 3, the data set and experimental results were expressed, evaluation metrics are proposed and calculated in Section 4 and finally, there is the conclusion in Section 5.
Predictive Models
In this paper, two neural networks with different structures (LSTM and NAR) were implemented as multi-step predictive models which are accurate models for analyzing time series data and forecasting future values. LSTM Neural Network LSTM is a type of Recurrent Neural Network (RNN) which could solve RNN’s long-term memory problem. The gates of LSTM control the flow of information and data and indicate which data is unimportant and must be deleted and which ones should be kept, so this network allows to passe only the important data to achieve the accurate output [22,23]. Figure 1 shows LSTM cell structure [24]. LSTM includes 3 gates, input, output and forget gates. Every cell has two inputs, xt and ht-1 also ht and ct as output. ct-1 is connected to ct directly which is possible to add or delete some data, in fact, unnecessary data is deleted by forget gate. c is the short form of cell state which is long-term memory. The data is always between -1 and 1 by using the tanh. The below equations make up LSTM network, where Wo, Wg, Wi and Wf are the weight matrices. bo, bg, bi and bf are bias vectors and σ indicates sigmoid activation functions. [24,25] (1) (2) (3)
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026
This network can be expressed by the below function [28] where y(t), f are forecasted value and nonlinear approximation function which is determined by NAR network during training and є (t) is the error.
(6) The training process is maintained until the minimum error or maximum epoch is achieved. According to the obtained results, the LSTM neural network is a successful deep learning approach based on a sophisticated network structure. It uses memory units in the model to capture time-series correlations. NAR (Nonlinear Auto-Regressive) Neural Network LSTM NAR neural network is an effective model to recognize time series patterns and nonlinear trends. In fact, it’s a dynamic network where the future values are forecasted only from past values. This network can be implemented as a time series forecasting model [26,27]. Figure 2 shows the NAR neural network structure [28].
Experimental Results
Monthly electricity consumption data from 1973-2022 in USA was used as the data set and input of the models which is shown in Figure 3. The data set is normalized by the following equation in order to achieve a similar scale by the min-max method, where X and Xn are actual and normalized values, XMIN and XMAX refer to minimum and maximum data’s values [29].
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026
(8) In LSTM, the time series data is divided into two parts for training (90%) and testing (10%) and in NAR into three parts, train (80%), Validation (10%) and test (10%). ANN parameters are usually set by previous experience in trial-and-error procedure, and we found that the best value for the hidden units is 300 in both networks. We trained our model depending on the dataset number that we have. At the first we divide our training to three parts. In the first part we chose a small number of hidden units which is between 100-150 and we got underfitting in our model. And then we tried to increase our hidden units to 450 units and then we got overfitting situation. So, the best situation was to choose 300 hidden units. Figure 4 shows the proposed layers structure for models. Table 1 represents the training details for the LSTM network, where the Gradient Decay Factor is equal to 0.9, as it is the optimum value between 0.9 and 0.99. The Initial Learning Rate falls within the range of 0.001 to 0.01, the Learning Rate Schedule specifies the temporal variations of the learning rate throughout the training process, and the Learning Rate Drop Factor is usually set to a value between
0.1. and 0.5. The Learning Rate Drop Period specifies the
frequency of learning rate updates, often adjusted by the drop factor. It indicates the number of epochs or training iterations after which the learning rate should decrease. The Max Epochs parameter is set to 250, considering the specific requirements of the LSTM modeling process. The Mini Batch Size, which denotes the amount of training data utilized in each gradient descent update, is set to 128 to provide more stable gradients and faster convergence. The Verbose Frequency is set to 50, meaning the training progress will be displayed after every 50 epochs. The Validation Frequency specifies how often the model’s performance is assessed on a validation dataset throughout the training process. In Table 2, For NAR, 80 percent of the data used for training and 10 percent for testing and 10 percent for validation. The epoch number is decided by using empirical testing and chosen to be 1000 epoch to capture the intricate patterns and dependencies in the data. As can be shown from the results in NAR the Gradient is too small and the model uncertainty (MU) is too big, and this indicates that the LSTM performance is better than NAR in this research.
Figure 4. Proposed layers structure for LSTM and NAR networks.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026
Figure 5 shows how the RMSE changes across iterations during the training phase in LSTM. It starts high, and at the 100th iteration, it stabilizes, indicating that the model has reached convergence. By the 250th iteration, it fits all the trained data. Figure 6 shows the performance of NAR in training. The Mu is almost stable at 0.05 throughout the training, indicating no adjustment was needed to facilitate learning
2.59. which means that the NAR model is near to local or
global minimum. In the first experiment, energy forecasting was done with LSTM network. Figure 7 shows a comparison of actual data and forecast, also the error which is the difference between these two values. In figure 7, the blue line represents the real data, and the red line shows the estimated data. According
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026
Figure 8. Forecasting, error (NAR). Figure 7. Forecasting, error (LSTM). (12)
to the result, MAPE is about 2.1748% which shows high accuracy of the model. The second graph shows the amount of errors in each test data point. As the second method, NAR neural network was used, and the performance of the model and error graphs are shown in Figure 8, although the MAPE is low which is around 4.7544% and the deviations are minimal, still the LSTM method shows better results than NAR.
Evaluation Metrics
The assessment of the presented networks was done by calculating 6 errors: MAPE, SMAPE, RMSE, MAE, MBE and R2 which are expressed by the below formulas [30,31]. (9)
(15) Where Xi, Yi and m are the actual value, forecasted value and the number of test data respectively.The results are expressed in Table 3. The fewer errors and the higher value of R2 in LSTM show this model is more accurate. In this study, the number of hidden units which were used in the networks for achieving optimal accuracy was 300. LSTM can produce more accurate output because of feedback connections and having short-term and long-term memories. The accuracy that we can see by using LSTM and NAR shows to us clearly that the proposed LSTM model achieves better
NAR NN
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026
performance in terms of estimating a long data when compared with the non-linear auto regressive (NAR). The evaluation was based on the coefficient of determination (R²) which is a number between 0 and 1 that measures how well a statistical model predicts an outcome and its shows that LSTM have a better performance (0.9318) than NAR (0.6387). Also, by looking at table 3 we can see that the MAPE, SMAPE, RMSE, MAE, MBE all these values indicate that LSTM is better than NAR. Figure 9 shows forecasting with LSTM till 2030 which can give a general view for planning. For this study LSTM and NAR were tested also with different datasets and different periods. The data were taken from Danish energy agency For Use of Electrical Energy Consumption from 2000 to 2020 and the results indicate that LSTM have a better Coefficient of determination (R2) = 0.8591 and better Mean Absolute Percentage Error MAPE=14.9 than NAR which it has a Coefficient of determination (R2) = 0.7683 and MAPE=20.23 as we can see from figures 10 and 11.
Conclusion
In this research, long-term electricity energy consumption was forecasted using MATLAB software with two predictive models, LSTM which is a kind of RNN and NAR (nonlinear autoregressive) neural network. The monthly energy consumption data from 1973-2022 in USA was used as a time series data set and input of the networks.The experimental results of both networks were compared and evaluation metrics in this study were different errors such as MAPE, SMAPE, RMSE, MAE, MBE and R2 for measuring forecasting accuracy. The lower value of the errors and the higher value of R2 in LSTM (0.9318) shows this model is more accurate than NAR (0.6387). Also, if we compared the Symmetric Mean Absolute Percentage Error in LSTM (2.1265) which gives better performance than the NAR (4.8278) and here also the lower value means the better performance. These results indicate that LSTM method is more efficient than NAR because LSTM has short-term and long-term memories which can keep information for long periods and has feedback connections. In fact, this network has shown better performance. For the future work, we will use the same data with different NN estimation methods like, for example NARX. Also, this work can be used to estimate the stock market. Also, to increase the accuracy of the model optimization algorithms like particle swarm optimization algorithm hyperparameters of LSTM can be used.
Data Availability Statement
The authors confirm that the data that supports the findings of this study are available within the article. Raw
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026
data that support the finding of this study are available from the corresponding author, upon reasonable request.
Conflict Of Interest
The author declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Ethics
There are no ethical issues with the publication of this manuscript.
Statement On The Use Of Artificial Intelligence
Artificial intelligence was not used in the preparation of the article.
References
- Kim TY, Cho SB. 2019. Predicting residential 2022;17:e0278071. [CrossRef] energy consumption using CNN-LSTM neural net- [16] Durand D, Aguilar J, R-Moreno MD. An Analysis works. Energy 2019;182:72–81. [CrossRef] of the Energy Consumption Forecasting Problem
- Kim JY, Cho SB. Electric Energy Consumption in Smart Buildings Using LSTM. Sustainability Prediction by Deep Learning with State Explainable 2022;14:13358. [CrossRef] Autoencoder. Energies 2019;12:739. [CrossRef] [17] Mpawenimana I, Pegatoquet A, Roy V, Rodriguez L,
- Djenouri D, Laidi R, Djenouri Y, Balasingham Belleudy C. A comparative study of LSTM and ARIMA I. Machine learning for smart building applica- for energy load prediction with enhanced data prepro- tions: Review and taxonomy. ACM Comput Surv cessing. IEEE Sens Appl Symp 2020;1–6. [CrossRef] 2019;52:1–36. [CrossRef] [18] Shi H, Xu M, Li R. Deep learning for household
- Silva FLC, Costa K, Rodrigues PC, Salas R, Gonzales load forecasting—A novel pooling deep RNN. IEEE JLL. Statistical and artificial neural networks mod- Trans Smart Grid 2017;9:5271–5280. [CrossRef] els for electricity consumption forecasting in the [19] Ramadevi B, Bingi. Time Series Forecasting Model Brazilian industrial sector. Energies, 2022;15:588. for Sunspot Number. IEEE Xplore 2022;1-6. [CrossRef] [CrossRef] [20] Sunder M, Abishek R, Maiti M, Bingi K, Devan
- Ajayi RO, Alaka H, Sulaimon I, Sunmola F, Ajayi PAM, Assaad M. Forecasting of Wind Turbines S. Building energy consumption prediction for Generated Power with Missing Input Variables. residential buildings using deep learning and 2022 International Conference on Future Trends in other machine learning techniques. J Build Eng Smart Communities (ICFTSC), Kuching, Sarawak, 2022;45:103406. [CrossRef] Malaysia, 2022, pp. 98-103. [CrossRef]
- Fathi S, Srinivasan R, Fenner A, Fathi S. Machine [21] Boudhaouia A, Wira P. Comparison of machine learning applications in urban building energy per- learning algorithms to predict daily water consump- formance forecasting: A systematic review. Renew tions. IEEE Xplore 2021;1–6. [CrossRef] Sustain Energy Rev 2020;133:110287. [CrossRef] [22] Torres JF, Álvarez FM, Troncoso A. A deep LSTM
- Bourhnane S, Abid MR, Lghoul R, Dine KZ, network for the Spanish electricity consumption Elkamoun N, Benhaddou D. Machine learning for forecasting. Neural Comput Appl 2022;34:10533– energy consumption prediction and scheduling in 10545. [CrossRef] smart buildings. SN Appl Sci 2020;2:1–10. [CrossRef] [23] Jang J, Han J, Leigh SB. Prediction of heating energy
- Donmez I, Aslan Z. Role of air pollution on COVID- consumption with operation pattern variables 19 in Istanbul. Sigma J Eng Nat Sci 2023;4:793–806. for non-residential buildings using LSTM net- [CrossRef] works. Energy Build 2022;255:111647. [CrossRef]
- Gozzoglu A, Ozgonenel O, Gezegin C. Modeling and [24] Wang B, Zhang L, Ma H, Wang H, Wan S. Parallel implementation of demand-side energy management LSTM-based regional integrated energy system system. Sigma J Eng Nat Sci 2024;42:1628–1645. multienergy source-load information interactive [CrossRef] energy prediction. Complexity 2019;1–13. [CrossRef] Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 153−161, February, 2026 161
- Jang G, Kim N, Ha T, Lee C, Cho S. Base station [29] Ghimire S, Huy TN, Prasad R, Deo RC, Perez DC, switching and sleep mode optimization with LSTM- Sanz SS, Bhandari B. Hybrid convolutional neural based user prediction. IEEE Access 2020;8:222711– network-multilayer perceptron model for solar radi- 222723. [CrossRef] ation prediction. Cogn Comput 2023;15:645–671.
- Sarkar R, Julai S, Hossain S, Chong WT, Rahman [CrossRef] M. A comparative study of activation functions of NAR and NARX neural network for long-term [30] Chicco D, Warrens MJ, Jurman G. The coefficient wind speed forecasting in Malaysia. Math Probl of determination R-squared is more informative Eng 2019:3:1–14. [CrossRef] than SMAPE, MAE, MAPE, MSE and RMSE in
- Khaleghi S, Karimi D, Beheshti SH, Hosen S, Behi H, regression analysis evaluation. PeerJ Comput Sci Berecibar M, et al. Online health diagnosis of lithi- 2021;7:e623. [CrossRef] um-ion batteries based on nonlinear autoregressive neu-
- Jiménez JAB, Estévez J, Marín APG. New machine ral network. Appl Energy 2021;282:116159. [CrossRef] learning approaches to improve reference evapo-
- Taherdangkoo R, Tatomir A, Taherdangkoo M, Qiu P, Sauter M. Nonlinear autoregressive neural networks transpiration estimates using intra-daily tempera- to predict hydraulic fracturing fluid leakage into shal- ture-based variables in a semi-arid region of Spain. low groundwater. Water 2020;12:841. [CrossRef] Agric Water Manag 2021;245:106558. [CrossRef]
Share and Cite
BEHGOUY, P.; UĞURENVER, A. Electricity energy consumption forecasting using LSTM and NAR. Sigma Journal of Engineering and Natural Sciences 2026, Vol. 44, pp. 153-161. https://doi.org/10.14744/sigma.2025.00056

