Volume 21 , Issue 2 , PP: 259-282, 2026 | Cite this article as | XML | Html | PDF | Full Length Article
Marwa M. Eid 1 *
Doi: https://doi.org/10.54216/FPA.210217
This paper addresses the challenge of predicting and analyzing electricity consumption patterns in Tetouan, Morocco, using time-series data. The dataset consists of 52,416 observations with 9 features, collected from the SCADA system of electricity consumption across three zones. The primary goal is to enhance forecasting accuracy and optimize prediction models through machine learning (ML) algorithms, including both timeseries models and advanced optimization techniques. We compare the performance of several baseline ML models, such as BiLSTM and Continuous Time Stochastic Modelling (CTSM), with their optimized versions, utilizing optimization algorithms like Greylag Goose Optimization (GGO), Bat Algorithm (BA), and Whale Optimization Algorithm (WOA). The results show that the optimized CTSM model, using GGO, achieved substantial improvements, including the lowest Mean Squared Error (MSE) of 7.09E-07 and the highest R² of 0.990, demonstrating superior accuracy and stability. The contributions of this work include (i) benchmarking various ML models for time-series forecasting, (ii) introducing the use of optimized CTSM with meta-heuristics, and (iii) evaluating model performance using a comprehensive set of statistical metrics.
Electricity Consumption Forecasting , Time-Series Prediction , Machine Learning , Greylag Goose Optimization , Energy Management
[1] A. R. Salam and A. E. Hibaoui, “Energy consumption profile of tetouan, morocco: Challenges and insights,” ResearchGate, vol. 12, no. 2, pp. 87–95, 2018. [Online]. Available: https : www . researchgate.net/publication/323567431.
[2] S. H. zain A. L. Thalabi, A. Heydari, and M. Tavakoli, “Optimization of hybridization of artificial neuron with chaotic genetic algorithm in prediction process/with the application,” Soft Computing, pp. 1–9, 2023. [Online]. Available: https://api.semanticscholar.org/CorpusID:259750301.
[3] M. Munem, T. M. R. Bashar, M. H. Roni, M. Shahriar, T. B. Shawkat, and H. Rahaman, “Electric power load forecasting based on multivariate lstm neural network using bayesian optimization,” 2020 IEEE Electric Power and Energy Conference (EPEC), pp. 1–6, 2020. [Online]. Available: https : //api.semanticscholar.org/CorpusID:231684748.
[4] A. Du, Y. Han, and Z. Zhu, “Review on multi-objective optimization of energy management strategy for hybrid electric vehicle integrated with traffic information,” Energy Sources, Part A: Recovery, Utilization, and Environmental Effects, vol. 44, pp. 7914 –7933, 2022. [Online]. Available: https: //api.semanticscholar.org/CorpusID:252025949.
[5] A. El Hibaoui and I. Kazi, “Challenges in forecasting electricity consumption in morocco: Weather and social impacts,” Journal of Energy Research, vol. 58, no. 4, pp. 1521–1535, 2025. DOI: 10.1016/ j . jener . 2025 . 02 . 016. [Online]. Available: https : / / www . sciencedirect . com / science/article/abs/pii/S0360544220302144.
[6] S. Dehua, R. XiangWei, W. ShaoHua, C. Yingfeng, S. Huaping, and Y. Tao, “Adaptive energy management strategy for hybrid electric vehicle based on power prediction,” Proceedings of the Institution of Mechanical Engineers, Part D: Journal of Automobile Engineering, vol. 237, pp. 1365 –1377, 2022. [Online]. Available: https://api.semanticscholar.org/CorpusID:248073366.
[7] A. T. Moghadam, F. Soheyli, S. Sanei, E. Akbari, H. Khorramdel, and M. Ghadamyari, “Bi-level optimization of the integrated energy systems in the deregulated energy markets considering the prediction of uncertain parameters and price-based demand response program,” Energy Science & Engineering, vol. 10, pp. 2772 –2793, 2022. [Online]. Available: https://api.semanticscholar.org/ CorpusID:251447444.
[8] C. Ji, E. Kamal, and R. Ghorbani, “Reliable energy optimization strategy for fuel cell hybrid electric vehicles considering fuel cell and battery health,” Energies, 2024. [Online]. Available: https : / / api.semanticscholar.org/CorpusID:272799913.
[9] M. Hassan and R. Gupta, “Optimization algorithms for time-series prediction in power consumption forecasting,” IEEE Transactions on Industrial Informatics, vol. 14, no. 5, pp. 3421–3434, 2017. DOI: 10.1109/TII.2017.2770578. [Online]. Available: https://ieeexplore.ieee.org/ document/8286559.
[10] M. Team, Population optimization algorithms: Bat algorithm (ba), 2018. [Online]. Available: https: //www.mql5.com/en/articles/2188.
[11] M. Team, Population optimization algorithms: Whale optimization algorithm (woa), 2019. [Online]. Available: https://www.mql5.com/en/articles/2435.
[12] J. F. Torres, F. Mart´ınez-Alvarez, and A. Troncoso, “A deep lstm network for the spanish electricity ´ consumption forecasting,” Neural Computing and Applications, vol. 34, no. 13, pp. 10 533–10 545, 2022. DOI: 10.1007/s00521-021-06773-2. [Online]. Available: https://doi.org/10. 1007/s00521-021-06773-2.
[13] S. K. Hora, R. Poongodan, R. P. de Prado, M. Wozniak, and P. B. Divakarachari, “Long short-term memory network-based metaheuristic for effective electric energy consumption prediction,” Applied Sciences, vol. 11, no. 23, p. 11 263, 2021. DOI: 10 . 3390 / app112311263. [Online]. Available: https://doi.org/10.3390/app112311263.
[14] D. Kumar, H. D. Mathur, S. Bhanot, and R. C. Bansal, “Forecasting of solar and wind power using lstm rnn for load frequency control in isolated microgrid,” International Journal of Modelling and Simulation, vol. 41, no. 4, pp. 311–323, 2021. DOI: 10.1080/02286203.2020.1767840. [Online]. Available: https://doi.org/10.1080/02286203.2020.1767840.
[15] M. Chiranjeevi, A. Madyastha, A. K. Maurya, T. Moger, and D. Jena, “Solar irradiation forecast enhancement using clustering based cnn-bilstm-attention hybrid architecture with pso,” International Journal of Ambient Energy, vol. 45, no. 1, p. 2 414 924, 2024. DOI: 10 . 1080 / 01430750 . 2024 . 2414924. [Online]. Available: https://doi.org/10.1080/01430750.2024.2414924.
[16] N.-T. Ngo, A.-D. Pham, N.-S. Truong, T. T. H. Truong, and N.-T. Huynh, “Hybrid machine learning for time-series energy data for enhancing energy efficiency in buildings,” in Computational Science – ICCS 2021, M. Paszynski, D. Kranzlmuller, V. V. Krzhizhanovskaya, J. J. Dongarra, and P. M. A. Sloot, Eds., ¨ Springer International Publishing, 2021, pp. 273–285. DOI: 10.1007/978-3-030-77977-1_21. [Online]. Available: https://doi.org/10.1007/978-3-030-77977-1_21.
[17] J.-S. Chou and D.-N. Truong, “Multistep energy consumption forecasting by metaheuristic optimization of time-series analysis and machine learning,” International Journal of Energy Research, vol. 45, no. 3, pp. 4581–4612, 2021. DOI: 10.1002/er.6125. [Online]. Available: https://doi.org/10. 1002/er.6125.
[18] M. Larrea, A. Porto, E. Irigoyen, A. J. Barragan, and J. M. And ´ ujar, “Extreme learning machine ensem- ´ ble model for time series forecasting boosted by pso: Application to an electric consumption problem,” Neurocomputing, vol. 452, pp. 465–472, 2021. DOI: 10.1016/j.neucom.2019.12.140. [Online]. Available: https://doi.org/10.1016/j.neucom.2019.12.140.
[19] R. Tiwari et al., “Enhanced power quality and forecasting for pv-wind microgrid using proactive shunt power filter and neural network-based time series forecasting,” Electric Power Components and Systems, vol. 0, no. 0, pp. 1–15, 2023. DOI: 10.1080/15325008.2023.2249894. [Online]. Available: https://doi.org/10.1080/15325008.2023.2249894.
[20] B. Baadji, S. Belagoune, and S. E. Boudjellal, “Transformer-based deep learning networks for fault detection, classification, and location prediction in transmission lines,” Network: Computation in Neural Systems, vol. 0, no. 0, pp. 1–21, 2024. DOI: 10 . 1080 / 0954898X . 2024 . 2393746. [Online]. Available: https://doi.org/10.1080/0954898X.2024.2393746.
[21] M. A. d. Silva, R. d. P. Garcia, and J. C. Carlo, “Performance assessment of rbfmopt, nsga2, and mhaco on the thermal and energy optimization of an office building,” Journal of Building Performance Simulation, vol. 16, no. 3, pp. 366–380, 2023. DOI: 10.1080/19401493.2022.2143568. [Online]. Available: https://doi.org/10.1080/19401493.2022.2143568.