Building an ARIMA Model for Predicting Time Series in Python

Authors

  • Gaukhar Abdenova
  • Zhanat Kenzhebayeva
  • Hanna Martyniuk

Keywords:

non-stationary time series, seasonal data, short-term forecasts, ARIMA

Abstract

This study showcases the practical application of the Box-Jenkins model, specifically ARIMA, to predict forthcoming values of a short-term economic indicator in the Republic of Kazakhstan. Data extracted from the Bureau of National Statistics website, covering the period from January 2009 to July 2021, served as the foundation for this analysis. Leveraging the Python programming language, the authors constructed the ARIMA model and conducted thorough time series analysis to uncover temporal patterns within the data. Validation of the model's performance was carried out using data from August 2021 to July 2022. The article presents a comprehensive methodology for model development, encompassing data preprocessing, parameter estimation, and model evaluation stages. Emphasis is placed on the necessity of regular data updates to uphold the accuracy of forecasts, underscoring the practical significance of this study within the domain of time series modeling and forecasting methodologies. As a result, using the constructed model, future values of the series were obtained and a comparison of the predicted values with real data was carried out. To check the error, the mean absolute error in percent (MAPE) was calculated, which was 7.2%. Checking the residual errors showed that the residuals have a normal distribution. This research contributes valuable insights into the application of advanced statistical techniques for economic forecasting, particularly in dynamically evolving contexts like Kazakhstan's economy.

References

Aasim, S. N. Singh, and A. Mohapatra, “Repeated wavelet transform based ARIMA model for very short-term wind speed forecasting,” Renewable Energy, vol. 136, pp. 758–768, 2019. https://doi.org/10.1016/j.renene.2019.01.031.

A. Lavanya, et al., “Assessing the performance of Python data visualization libraries: a review,” Int. J. Comput. Eng. Res. Trends, vol. 10, issue 1, pp. 28-39, 2023. https://doi.org/10.22362/ijcert/2023/v10/i01/v10i0104.

J. Banaś and K. Utnik-Banaś, “Evaluating a seasonal autoregressive moving average model with an exogenous variable for short-term timber price forecasting,” Forest Policy and Economics, vol. 131, p. 102564, 2021. https://doi.org/10.1016/j.forpol.2021.102564.

W. W. S. Wei, “Dimension reduction in high dimensional multivariate time series analysis,” In: Zhang, L., Chen, DG., Jiang, H., Li, G., Quan, H. (eds) Contemporary Biostatistics with Biopharmaceutical Applications. ICSA Book Series in Statistics, Springer, Cham. https://doi.org/10.1007/978-3-030-15310-6_3.

D. J. Pedregal, “Time series analysis and forecasting with ECOTOOL,” PloS one, vol. 14, issue 10, e0221238, 2019. https://doi.org/10.1371/journal.pone.0221238.

R. J. Hyndman and G. Athanasopoulos, Forecasting: Principles and Practice, 2nd ed., OTexts, 2018. https://doi.org/10.32614/CRAN.package.fpp2.

E. Dave, A. Leonardo, M. Jeanice, and N. Hanafiah, “Forecasting Indonesia exports using a hybrid model ARIMA-LSTM,” Procedia Computer Science, vol. 179, pp. 480–487, 2021. https://doi.org/10.1016/j.procs.2021.01.031.

H. Guo, Q. Chen, Q. Xia, C. Kang, and X. Zhang, “A monthly electricity consumption forecasting method based on vector error correction model and self-adaptive screening method,” Int. J. Electr. Power Energy Syst., vol. 95, pp. 427–439, 2018. https://doi.org/10.1016/j.ijepes.2017.09.011.

M. K. Ahmadzai and M. Eliw, “Using ARIMA models to forecasting of economic variables of wheat crop in Afghanistan,” Asian J. Econ. Bus. Account., vol. 13, issue 4, pp. 1–21, 2020. https://doi.org/10.9734/ajeba/2019/v13i430180.

M. S. Khan and U. Khan, “Comparison of forecasting performance with VAR vs. ARIMA models using economic variables of Bangladesh,” Asian J. Probab. Stat., vol. 10, issue 2, pp. 33–47, 2020. https://doi.org/10.9734/ajpas/2020/v10i230243.

M. Elsaraiti, A. Merabet, & A. Al-Durra, “Time series analysis and forecasting of wind speed data,” Proceedings of the 2019 IEEE Industry Applications Society Annual Meeting, 2019, pp. 1-5. https://doi.org/10.1109/IAS.2019.8912392.

Yu. M. Minaev, O. Yu. Filimonova, and Yu. I. Minaeva, “Forecasting of fuzzy time series based on the concept of the nearest fuzzy sets and tensor models of time series,” Cybernetics and Systems Analysis, vol. 59, no. 1, pp. 165-176, 2023. https://doi.org/10.1007/s10559-023-00551-9.

A. Zemkoho, “A basic time series forecasting course with Python,” Operations Research Forum, vol. 4, no. 1, Cham: Springer International Publishing, 2022. https://doi.org/10.1007/s43069-022-00179-z.

R. Adhikari, and R. K. Agrawal, “An introductory study on time series modeling and forecasting,” arXiv preprint arXiv:1302.6613, 2013.

W. Polasek, “Time series analysis and its applications: With R examples,” рр. 323-325, 2013. https://doi.org/10.1111/insr.12020_15.

S. Siami-Namini, N. Tavakoli, and A. Siami Namin, “A comparison of ARIMA and LSTM in forecasting time series,” Proceedings of the 2018 17th IEEE Int. Conf. Mach. Learn. Appl. (ICMLA), 2018, pp. 1394-1401. https://doi.org/10.1109/ICMLA.2018.00227.

Agency for Strategic Planning and Reforms of the Republic of Kazakhstan Bureau of National Statistics, “The short-term economic indicator,” Dataset, 2022. [Online]. Available at: https://stat.gov.kz/api/getFile/?docId=ESTAT108589.

Ch. Faloutsos, et al., “Forecasting big time series: old and new,” Proceedings of the VLDB Endowment, vol. 11, no. 12, рр. 2102-2105, 2018. https://doi.org/10.14778/3229863.3229878.

Y. Liang, et al., “Foundation models for time series analysis: A tutorial and survey,” Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2024, pp. 6555-6565. https://doi.org/10.1145/3637528.3671451.

Y. Zou, et al., “Complex network approaches to nonlinear time series analysis,” Physics Reports, vol. 787, рр. 1-97, 2019. https://doi.org/10.1016/j.physrep.2018.10.005.

K. M. Bazikova, G. A. Abdenova, and G. E. Sagyndykova, “Linear stochastic distributed model of money accumulation in the form of a state space,” KazNU Bulletin. Mathematics, Mechanics, Computer Science Series, vol. 110, no. 2, pp. 128–138, 2021. https://doi.org/10.26577/JMMCS.2021.v110.i2.11.

A. Abdenov, G. Abdenova, Z. Kenzhebayeva, and A. Mukhanova, “Labour productivity prediction estimate in manufacturing environment using regression and dynamic models,” Mater. Today: Proc., vol. 16, pp. 254–261, 2019. https://doi.org/10.1016/j.matpr.2019.05.087.

A. Abdenov, G. Abdenova, and D. Kulbayev, “Estimation of equation coefficients of free and forced string vibrations in continuous medium with consideration of dynamic noise and measurement noise,” Mater. Today: Proc., vol. 16, pp. 336–342, 2019. https://doi.org/10.1016/j.matpr.2019.05.099.

A. R. Musin, “Comparison of the quality of forecast models of the foreign exchange market using Kalman filtering and traditional time series models,” Internet J. “SCIENCE”, vol. 9, no. 3, 2017.

A. S. Sorokin and A. R. Musin, “On the issue of using the Kalman filter in econometric models,” Science and Practice, no. 1(25), pp. 71–76, 2017.

A. Khulood, B. Zafar, and A. Mueen, “Time series forecasting using LSTM and ARIMA,” International Journal of Advanced Computer Science and Applications, vol. 14, no. 1, pp. 313-320, 2023. https://doi.org/10.14569/IJACSA.2023.0140133.

Downloads

Published

2025-07-01

How to Cite

Abdenova, G., Kenzhebayeva, Z., & Martyniuk, H. (2025). Building an ARIMA Model for Predicting Time Series in Python. International Journal of Computing, 24(2), 369-376. Retrieved from https://www.computingonline.net/computing/article/view/4021

Issue

Section

Articles