Research Article | | Peer-Reviewed

Comparative Analysis of ARIMA and LSTM Models for Temperature Forecasting in Semi-Arid Regions: A Case Study of Machakos County, Kenya

Received: 28 April 2025     Accepted: 16 May 2025     Published: 3 June 2025
Views:       Downloads:
Abstract

Accurate temperature forecasting is vital for agriculture, disaster management, and climate resilience, particularly in semi-arid regions like Machakos County, Kenya. Traditional forecasting models, such as the Auto Regressive Integrated Moving Average (ARIMA), have been widely used for both short- and long-term temperature predictions. However, with advancements in machine learning, there is a growing need to evaluate how modern methods compare to traditional approaches. This research focused on comparing the predictive accuracy of ARIMA and the Long Short-Term Memory (LSTM) model, a deep learning algorithm that uses a gating mechanism to capture non-linear patterns in data. The study used Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and the Diebold-Mariano statistical test to evaluate and compare the performance of models. Temperature data was obtained from the National Aeronautics and Space Administration’s Prediction of Worldwide Energy Resource (NASA POWER) database, using GPS coordinates to retrieve location-specific data for Machakos County. To ensure robust analysis, Python libraries such as Statsmodels, Pandas, TensorFlow, NumPy, Keras, and Matplotlib were used for data processing, fitting of models, and visualization of results. Findings showed that LSTM performed better in long-term predictions, achieving higher accuracy for 30-day forecasts, while both models performed significantly equivalently in the short term of 7 days. These findings highlight the complementary strengths of traditional and deep learning models in addressing different forecasting needs.

Published in American Journal of Artificial Intelligence (Volume 9, Issue 1)
DOI 10.11648/j.ajai.20250901.15
Page(s) 46-54
Creative Commons

This is an Open Access article, distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution and reproduction in any medium or format, provided the original work is properly cited.

Copyright

Copyright © The Author(s), 2025. Published by Science Publishing Group

Keywords

Temperature Forecasting, Long Short-Term Memory (LSTM), Auto-regressive Integrated Moving Average (ARIMA), Machine Learning, Deep Learning

References
[1] G. E. P. Box and G. M. Jenkins, Time Series Analysis: Forecasting and Control. San Francisco, CA: Holden- Day, 1970.
[2] H.-X. Zhao and F. Magoules, “A review on the prediction of building energy consumption,” Renew. Sustain. Energy Rev., vol. 16, no. 6, pp. 3586–3592, 2012,
[3] S. A. Aye and O. Karaman, “Forecasting daily temperature using ARIMA and ARIMAX models,” in Proc. 2018 Int. Conf. Artif. Intell. Data Process. (IDAP), Malatya, Turkey, 2018, pp. 1–5.
[4] O. Claveria and S. Torra, “Forecasting tourism demand to Catalonia: Neural networks vs. time series models,” Econ. Model., vol. 36, pp. 220–228, 2014,
[5] V. Bianco, O. Manca, and S. Nardini, “Electricity consumption forecasting in Italy using linear regression models,” Energy, vol. 34, no. 9, pp. 1413–1421, 2009,
[6] A. L. Maia, F. L. de Oliveira, and F. G. da Silva, “Forecasting models for ambient temperature of unshaded environments,” Energy Buildings, vol. 41, no. 8, pp. 874–878, 2009,
[7] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Comput., vol. 9, no. 8, pp. 1735–1780, 1997,
[8] A. Sagheer and M. Kotb, “Time series forecasting of petroleum production using deep LSTM recurrent networks,” Neurocomputing, vol. 323, pp. 203–213, 2019,
[9] O. B. Sezer, V. M. Sezer, V. S. Gürısık, A. A. Önder, Ö. Meydanoğlu, and M. R. Şenyüz, “Bagging LSTM ensemble model for multi-day temperature forecasting,” Environmental Science and Pollution Research, vol. 29, no. 24, pp. 36264–36278, 2022,
[10] O. S. Sajo et al., “Modelling the canopy conductance of cocoa tree using a recurrent neural network,” Am. J. Neural Netw. Appl., vol. 7, no. 2, pp. 22–27, 2021.
[11] İ. Tuğal and F. Sevgin, “Analysis and forecasting of temperature using time series forecasting methods: A case study of Mus¸,” Thermal Science, vol. 27, pp. 3081– 3088, 2023,
[12] S. Siami-Namini, N. Tavakoli, and A. S. Namin, “A comparison of ARIMA and LSTM in forecasting time series,” in Proc. 17th IEEE Int. Conf. Mach. Learn. Appl. (ICMLA), Orlando, FL, USA, 2018, pp. 1394– 1401,
[13] D. Sumanta and M. Shymapada, “A comparative study of seasonal-ARIMA and RNN (LSTM) on time series temperature data forecasting,” in Pervasive Comput. Social Netw., Singapore: Springer, 2022, pp. 263–273,
[14] R. Qiu et al., “River water temperature forecasting using a deep learning method,” J. Hydrol., vol. 595, p. 126016, Apr. 2021,
[15] A. G. Salman, Y. Heryadi, E. Abdurahman, and W. Suparta, “Single-layer and multi-layer LSTM model for weather forecasting,” in Proc. 2018 Int. Semin. Res. Inf. Technol. Intell. Syst. (ISRITI), Yogyakarta, Indonesia, 2018, pp. 112–117,
[16] J. Zhang, Y. Zheng, D. Qi, R. Li, and X. Yi, “DNNbased prediction model for spatio-temporal data: A traffic data case,” Proc. ACM Interact. Mob. Wearable Ubiquitous Technol., vol. 3, no. 2, pp. 1–24, 2019,
[17] J. B. Elsner and C. P. Schmertmann, “Assessing forecasts on a global scale from the lens of local behavior: A conceptual discussion with insights from daily temperature forecasts over the United States,” Weather Forecast., vol. 35, no. 4, pp. 1539–1555, 2020,
[18] Z. Karevan and J. A. Suykens, “Transductive multiview learning for multi-output regression,” IEEE Trans. Neural Netw. Learn. Syst., vol. 32, no. 12, pp. 5423–5437, 2021,
[19] L. A. Monteiro, P. C. Sentelhas, and G. U. Pedra, “Assessment of NASA/POWER satellite-based weather system for Brazilian conditions and its impact on sugarcane yield simulation,” Int. J. Climatol., vol. 38, no. 3, pp. 1571–1581, 2018,
[20] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: A simple way to prevent neural networks from overfitting,” J. Mach. Learn. Res., vol. 15, no. 1, pp. 1929–1958, 2014.
[21] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv: 1412.6980, 2014.
Cite This Article
  • APA Style

    Mutiso, N. M., Kithinji, M. M., Musau, V. M. (2025). Comparative Analysis of ARIMA and LSTM Models for Temperature Forecasting in Semi-Arid Regions: A Case Study of Machakos County, Kenya. American Journal of Artificial Intelligence, 9(1), 46-54. https://doi.org/10.11648/j.ajai.20250901.15

    Copy | Download

    ACS Style

    Mutiso, N. M.; Kithinji, M. M.; Musau, V. M. Comparative Analysis of ARIMA and LSTM Models for Temperature Forecasting in Semi-Arid Regions: A Case Study of Machakos County, Kenya. Am. J. Artif. Intell. 2025, 9(1), 46-54. doi: 10.11648/j.ajai.20250901.15

    Copy | Download

    AMA Style

    Mutiso NM, Kithinji MM, Musau VM. Comparative Analysis of ARIMA and LSTM Models for Temperature Forecasting in Semi-Arid Regions: A Case Study of Machakos County, Kenya. Am J Artif Intell. 2025;9(1):46-54. doi: 10.11648/j.ajai.20250901.15

    Copy | Download

  • @article{10.11648/j.ajai.20250901.15,
      author = {Noah Mutavi Mutiso and Martin Mutwiri Kithinji and Victor Muthama Musau},
      title = {Comparative Analysis of ARIMA and LSTM Models for Temperature Forecasting in Semi-Arid Regions: A Case Study of Machakos County, Kenya},
      journal = {American Journal of Artificial Intelligence},
      volume = {9},
      number = {1},
      pages = {46-54},
      doi = {10.11648/j.ajai.20250901.15},
      url = {https://doi.org/10.11648/j.ajai.20250901.15},
      eprint = {https://article.sciencepublishinggroup.com/pdf/10.11648.j.ajai.20250901.15},
      abstract = {Accurate temperature forecasting is vital for agriculture, disaster management, and climate resilience, particularly in semi-arid regions like Machakos County, Kenya. Traditional forecasting models, such as the Auto Regressive Integrated Moving Average (ARIMA), have been widely used for both short- and long-term temperature predictions. However, with advancements in machine learning, there is a growing need to evaluate how modern methods compare to traditional approaches. This research focused on comparing the predictive accuracy of ARIMA and the Long Short-Term Memory (LSTM) model, a deep learning algorithm that uses a gating mechanism to capture non-linear patterns in data. The study used Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and the Diebold-Mariano statistical test to evaluate and compare the performance of models. Temperature data was obtained from the National Aeronautics and Space Administration’s Prediction of Worldwide Energy Resource (NASA POWER) database, using GPS coordinates to retrieve location-specific data for Machakos County. To ensure robust analysis, Python libraries such as Statsmodels, Pandas, TensorFlow, NumPy, Keras, and Matplotlib were used for data processing, fitting of models, and visualization of results. Findings showed that LSTM performed better in long-term predictions, achieving higher accuracy for 30-day forecasts, while both models performed significantly equivalently in the short term of 7 days. These findings highlight the complementary strengths of traditional and deep learning models in addressing different forecasting needs.},
     year = {2025}
    }
    

    Copy | Download

  • TY  - JOUR
    T1  - Comparative Analysis of ARIMA and LSTM Models for Temperature Forecasting in Semi-Arid Regions: A Case Study of Machakos County, Kenya
    AU  - Noah Mutavi Mutiso
    AU  - Martin Mutwiri Kithinji
    AU  - Victor Muthama Musau
    Y1  - 2025/06/03
    PY  - 2025
    N1  - https://doi.org/10.11648/j.ajai.20250901.15
    DO  - 10.11648/j.ajai.20250901.15
    T2  - American Journal of Artificial Intelligence
    JF  - American Journal of Artificial Intelligence
    JO  - American Journal of Artificial Intelligence
    SP  - 46
    EP  - 54
    PB  - Science Publishing Group
    SN  - 2639-9733
    UR  - https://doi.org/10.11648/j.ajai.20250901.15
    AB  - Accurate temperature forecasting is vital for agriculture, disaster management, and climate resilience, particularly in semi-arid regions like Machakos County, Kenya. Traditional forecasting models, such as the Auto Regressive Integrated Moving Average (ARIMA), have been widely used for both short- and long-term temperature predictions. However, with advancements in machine learning, there is a growing need to evaluate how modern methods compare to traditional approaches. This research focused on comparing the predictive accuracy of ARIMA and the Long Short-Term Memory (LSTM) model, a deep learning algorithm that uses a gating mechanism to capture non-linear patterns in data. The study used Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and the Diebold-Mariano statistical test to evaluate and compare the performance of models. Temperature data was obtained from the National Aeronautics and Space Administration’s Prediction of Worldwide Energy Resource (NASA POWER) database, using GPS coordinates to retrieve location-specific data for Machakos County. To ensure robust analysis, Python libraries such as Statsmodels, Pandas, TensorFlow, NumPy, Keras, and Matplotlib were used for data processing, fitting of models, and visualization of results. Findings showed that LSTM performed better in long-term predictions, achieving higher accuracy for 30-day forecasts, while both models performed significantly equivalently in the short term of 7 days. These findings highlight the complementary strengths of traditional and deep learning models in addressing different forecasting needs.
    VL  - 9
    IS  - 1
    ER  - 

    Copy | Download

Author Information
  • Department of Mathematics, Division of Statistics and Data Science, Kirinyaga University, Kerugoya, Kenya

  • Department of Mathematics, Division of Statistics and Data Science, Kirinyaga University, Kerugoya, Kenya

  • Department of Mathematics, Division of Statistics and Data Science, Kirinyaga University, Kerugoya, Kenya

  • Sections