Comparative statistical modeling of dynamic series for forecasting daily electricity consumption in Python, R, C#, C++, Go, and Java
A.E. Dzgoev, Xiang Hua, A.D. Lagunova, Ya.A. Kopylova, D.V. Morozov, Ya.V. Mazhey, A.V. Brailovsky, D.A. Yudin, R. Allabergenov
Upload the full text
Abstract: Forecasting electricity consumption is an important tool for energy companies to ensure the stability and economic efficiency of the national energy system. For large industrial enterprises, accurate
forecasting allows them to optimize production costs and avoid financial losses due to imbalances and high electricity tariffs.
Aim. The study is to construct a detailed step-by-step algorithm for developing an adequate mathematical model for hourly forecasting of electricity consumption at an enterprise, using the method of statistical analysis of dynamic series in various programming languages.
Materials and methods. The modeling and forecasting algorithm is based on the classical ordinary least squares (OLS) method for small data samples, as well as the moving matrix method. The mathematical apparatus of the data processing method was implemented using the Mathcad Express engineering software. The implementation of the data processing method using modern programming languages is demonstrated: Python, R, C#, C++, Go, and Java.
Results. The authors implemente an algorithm for calculating daily electricity consumption forecasts using the classical sliding matrix method in Python, R, C#, C++, Go, and Java for subsequent code comparison. The authors present the results of a comparison of the forecasting algorithm implementations based on the following criteria: number of lines of code and execution time, use of external resources, parallelism support, and code size (in characters). Specific examples demonstrate that the choice of programming language depends on the problem being solved by researchers and developers. The adequacy of the developed regression model is statistically proven, and the equation quality is verified. Confidence intervals for the error corridor of the forecast model have been calculated.
Conclusions. The study demonstrate that the task of system data analysis and energy consumption forecasting is effectively solved using the Python programming language. The code for implementing the classical sliding matrix method is available in an open repository on GitHub at the following link: https://github.com/CollaborativeProgrammingTeam/Method-of-Classical-sliding-matrix.
Keywords: classical sliding matrix method, mathematical statistics, adequate regression model, quality assessment, forecasting of power consumption, comparison of programming languages, regression problem, comparative software implementation
For citation. Dzgoev A.E., Xiang Hua, Lagunova A.D., Kopylova Ya.A., Morozov D.V., Mazhey Ya.V., Brailovsky A.V., Yudin D.A., Allabergenov R. Comparative statistical modeling of dynamic series in forecasting daily electricity consumption in Python, R, C#, C++, Go, Java // News of the Kabardino-Balkarian Scientific Center of RAS. 2026. Vol. 28. No. 1. Pp. 39–56. DOI: 10.35330/1991-6639-2026-28-1-39-56
© Dzgoev A.E., Xiang Hua, Lagunova A.D., Kopylova Ya.A., Morozov D.V., Mazhey Ya.V., Brailovsky A.V., Yudin D.A., Allabergenov R., 2026

Content is available under license Creative Commons Attribution 4.0 License
References
- Hota H.S., Handa R., Shrivas A.K. Time series data prediction using sliding window based rbf neural network. International Journal of Computational Intelligence Research. 2017. Vol. 13. No. 5. Pp. 1145–1156.
- Zhan Z., Kim S.K. Versatile time-window sliding machine learning techniques for stock market forecasting. Artificial Intelligence Review. 2024. Vol. 57. ID. 209. DOI: 10.1007/s10462-024-10851-x
- Dalal S., Lilhore U.K., Seth B. et al. A hybrid model for short-term energy load prediction based on transfer learning with lightGBM for smart grids in smart energy systems. Journal of Urban Technology. 2024. DOI: 10.1080/10630732.2024.2380639
- Kolvakh V.F. Prognozirovanie slozhnykh protsessov s pomoshchyu kombinirovannykh ryadov [Forecasting Complex Processes Using Combined Series]: tutorial. Vladikavkaz: SKGMI (GTU), 2006. 214 p. (In Russian)
- Lapushkin M.K. Forecasting electricity consumption based on electric vehicle registration data. Issledovaniya molodykh uchenykh: materialy LXXXII Mezhdunarodnoy nauchnoy konferentsii. [Research by Young Scientists: Proceedings of the LXXXII International Scientific Conference] (Kazan, May 2024). Kazan: Molodoy uchenyy, 2024. Pp. 65–75. EDN: UIPBFW. (In Russian)
- Chen A., Pan Z., Liu J. et al. Study on forecasting electricity consumption based on statistical modeling. Journal of Physics Conference Series. 2025. Vol. 3012. No. 1. P. 012067. DOI: 10.1088/1742-6596/3012/1/012067
- Gramovich Ya.V., Musatov D.Yu., Petrusevich D.A. Application of begging in time series forecasting. Russian Technological Journal. 2024. Vol. 12. No. 1. Pp. 101−110. DOI: 10.32362/2500-316X-2024-12-1-101-110. (In Russian)
- Dzgoev A.E. Metody obrabotki i analiza dannykh dlya razrabotki prediktivnykh modeley [Data Processing and Analysis Methods for Developing Predictive Models.]: a tutorial. Moscow: RTU MIREA, 2024. 147 p. (In Russian)
- Zhang W., Liu J., Deng W. et al. AMTCN: An attention-based multivariate temporal convolutional network for electricity consumption prediction. Electronics. 2024. Vol. 13. P. 4080. DOI: 10.3390/ electronics13204080
- Kassem S.A., Ibragim A.Kh.A., Khasan A.M., Logacheva A.G. Forecasting electric consumption of enterprise using artificial neural networks. Tyumen State University Herald. Physical and Mathematical Modeling. Oil, Gas, Energy. 2021. Vol. 7. No. 1(25). Pp. 177–193. DOI: 10.21684/2411-7978-2021-7-1-177-193. (In Russian)
- Glazyrin A.S., Bolovin E.V., Arkhipova O.V. et al. Adaptive short-term forecasting of electricity consumption by autonomous power systems of small northern settlements based on retrospective regression analysis methods. Bulletin of The Tomsk Polytechnic University. GeoAssets Engineering. 2023. Vol. 334. No. 4. Pp. 231–248. DOI: 10.18799/24131830/2023/4/4213. (In Russian)
- Yu K., Cao J., Chen X. et al. Residential load forecasting based on electricity consumption pattern clustering. Frontiers in Energy Research. 2023. Vol. 10. P. 1113733. DOI: 10.3389/fenrg.2022.1113733
- Yuan B., He B., Yan J. et al. Short-term electricity consumption forecasting method based on empirical mode decomposition of long-short term memory network. IOP Conf. Series: Earth and Environmental Science. 2022. Vol. 983. P. 012004. DOI: 10.1088/1755-1315/983/1/012004
- Bortnik D.V., Orlov A.I. Comparison of neural network architectures to predicting electricity consumption by enterprise. Vestnik Chuvashskogo Universiteta. 2023. No. 4. Pp. 57–65. DOI: 10.47026/1810-1909-2023-4-57-65. (In Russian)
- Alkatsev M.I., Dzgoev A.E., Betrozov M.S. Issledovanie i razrabotka metoda prognozirovaniya potrebleniya elektroenergii v sisteme upravleniya elektrosnabzheniem regiona [Research and development of a method for forecasting electricity consumption in a regional power supply management system]. Izvestiya vysshikh uchebnykh zavedeniy. Problemy energetiki [Proceedings of Higher Educational Institutions. Energy Problems]. 2012. No. 5-6. Pp. 30–37. EDN: PCYGBL. (In Russian)
- Koltygin D.S., Zelenkov I.A. Analiz proizvoditelnosti sortirovki massivov dannykh pri ispolzovanii yazykov programmirovaniya raznykh urovney [Performance analysis of sorting data arrays using programming languages of different levels.] Trudy Bratskogo gosudarstvennogo universiteta. Seriya: estestvennye i inzhenernye nauki [Proceedings of Bratsk State University. Series: Natural Sciences and Engineering]. 2024. Vol. 1. Pp. 17–21. EDN: BLFPMT. (In Russian)
- Mirzoeva K.A. Metodika obucheniya yazykov programmirovaniya Phyton, C++ i ikh sravnenie [Methods for teaching Python and C++ programming languages and their comparison]. Society and innovations. 2022. Vol. 3. No. 3. Pp. 126–133. DOI: 10.47689/2181-1415-vol3-iss3-pp126-133. (In Russian)
- Dzizinskaya D.V., Ledneva O.V., Tindova M.G., Yazykova S.V. Forecasting electricity consumption time series in the R programming environment. Journal of Applied Informatics. 2025. Vol. 20. No. 2. Pp. 126–143. DOI: 10.37791/2687-0649-2025-20-2-126-143
- Ivanov A.A. Spravochnik po elektrotekhnike [Handbook of Electrical Engineering]. Kiev: Vishcha shkola, 1972. (In Russian)
- Kukhling Kh. Spravochnik po fizike [Handbook of Physics]: transl. Germany. Moscow: Mir, 1982. 520 p. (In Russian)
- Voytenkova E.D., Dzgoev A.E. Srednesrochnoye prognozirovaniye elektropotrebleniya byudzhetnoy obrazovatelnoy organizatsii s pomoshchyu metoda skolzyashchey matritsy [Mediumterm forecasting of electricity consumption of a budgetary educational organization using the sliding matrix method]. V sbornike: Informatsionnyye tekhnologii intellektualnoy podderzhki prinyatiya resheniy (pamyati prof. N.I. Yusupovoy) [Information Technologies for Intelligent Decision Support (in memory of Prof. N.I. Yusupova)]. ITIDS’2024. 2024. Pp. 242–248. (In Russian)
Information about the authors
Alan E. Dzgoev, Candidate of Technical Sciences, Associate Professor, Associate Professor of the Digital Transformation Department, Institute of Information Technology, MIREA – Russian Technological
University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
dzgoev@mirea.ru, ORCID: https://orcid.org/0000-0002-1314-6151, SPIN-code: 8092-8784
Xiang Hua, Candidate of Technical Sciences, Senior Researcher, Institute of Mechanical Engineering, Beijing Institute of Technology;
5, Zhongguancun street, Weigongcun, Bei Jing Shi, Haidian District, Beijing, 100811, China;
huaxiang@bit.edu.cn, ORCID: https://orcid.org/0000-0003-4429-1893
Anna D. Lagunova, Candidate of Economic Sciences, Associate Professor, Head of the Digital Transformation Department, Institute of Information Technology, MIREA – Russian Technological University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
lagunova@mirea.ru, ORCID: https://orcid.org/0000-0003-3572-8192, SPIN-code: 4067-3038
Yana A. Kopylova, Assistant, Digital Transformation Department, Institute of Information Technology, MIREA – Russian Technological University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
kopylova_y@mirea.ru, ORCID: https://orcid.org/0009-0001-0060-6753, SPIN-code: 4909-1501
Daniil V. Morozov, Assistant, Digital Transformation Department, Institute of Information Technology, MIREA – Russian Technological University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
morozov_dav@mirea.ru, ORCID: https://orcid.org/0009-0005-5187-4124, SPIN-code: 6133-0974
Yaroslav V. Mazhey, Assistant Professor, Department of Digital Transformation, Institute of Information Technology, MIREA – Russian Technological University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
mazhej@mirea.ru, ORCID: https://orcid.org/0009-0003-9115-2295, SPIN-code: 5038-3572
Andrey V. Brailovsky, Assistant Professor, Department of Digital Transformation, Institute of Information Technology, MIREA – Russian Technological University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
brajlovskij@mirea.ru, ORCID: https://orcid.org/0009-0006-1794-7825, SPIN-code: 5900-1835
Dmitry А. Yudin, Student majoring in Software Engineering, Institute of Information Technology, MIREA – Russian Technological University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
yudin.d.a@edu.mirea.ru, ORCID: https://orcid.org/0009-0005-9587-2016
Ruslan Allabergenov, Student majoring in Software Engineering, Institute of Information Technology, MIREA – Russian Technological University;
78, Vernadsky prospekt, Moscow, 119454, Russia;
ruslan_tm2003@mail.ru, ORCID: https://orcid.org/0009-0002-5525-6524
Funding
The study was performed without external funding.











