IDEAS home Printed from https://ideas.repec.org/p/spa/wpaper/2023wpecon13.html
   My bibliography  Save this paper

ARIMA and LSTM: A Comparative Analysis of Financial Time Series Forecasting

Author

Listed:
  • Joao Vitor Matos Goncalves
  • Michel Alexandre
  • Gilberto Tadeu Lima

Abstract

This paper assesses the impact of time horizon on the relative performance of traditional econometric models and machine learning models in forecasting stock market prices. We employ an extensive daily series of Brazil IBX50 closing prices between 2012 and 2022 to compare the performance of two forecasting models: ARIMA (autoregressive integrated moving average) and LSTM (long short-term memory) models. Our results suggest that the ARIMA model predicts better data points that are closer to the training data, as it loses predictive power as the forecast window increases. We also find that the LSTM model is a more reliable source of prediction when dealing with longer forecast windows, yielding good results in all the windows tested in this paper.

Suggested Citation

  • Joao Vitor Matos Goncalves & Michel Alexandre & Gilberto Tadeu Lima, 2023. "ARIMA and LSTM: A Comparative Analysis of Financial Time Series Forecasting," Working Papers, Department of Economics 2023_13, University of São Paulo (FEA-USP).
  • Handle: RePEc:spa:wpaper:2023wpecon13
    as

    Download full text from publisher

    File URL: http://www.repec.eae.fea.usp.br/documentos/Goncalves_Alexandre_Lima_13WP.pdf
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Domenico Giannone & Michele Lenza & Giorgio E. Primiceri, 2021. "Economic Predictions With Big Data: The Illusion of Sparsity," Econometrica, Econometric Society, vol. 89(5), pages 2409-2437, September.
    2. Philippe Goulet Coulombe & Maxime Leroux & Dalibor Stevanovic & Stéphane Surprenant, 2022. "How is machine learning useful for macroeconomic forecasting?," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 37(5), pages 920-964, August.
    3. Cheung, Yin-Wong & Lai, Kon S, 1995. "Lag Order and Critical Values of the Augmented Dickey-Fuller Test," Journal of Business & Economic Statistics, American Statistical Association, vol. 13(3), pages 277-280, July.
    4. Garcia, Márcio G.P. & Medeiros, Marcelo C. & Vasconcelos, Gabriel F.R., 2017. "Real-time inflation forecasting with high-dimensional models: The case of Brazil," International Journal of Forecasting, Elsevier, vol. 33(3), pages 679-693.
    5. Ricardo P. Masini & Marcelo C. Medeiros & Eduardo F. Mendes, 2023. "Machine learning advances for time series forecasting," Journal of Economic Surveys, Wiley Blackwell, vol. 37(1), pages 76-111, February.
    6. Rachidi Kotchoni & Maxime Leroux & Dalibor Stevanovic, 2019. "Macroeconomic forecast accuracy in a data‐rich environment," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 34(7), pages 1050-1072, November.
    7. Goodell, John W. & Kumar, Satish & Lim, Weng Marc & Pattnaik, Debidutta, 2021. "Artificial intelligence and machine learning in finance: Identifying foundations, themes, and research clusters from bibliometric analysis," Journal of Behavioral and Experimental Finance, Elsevier, vol. 32(C).
    8. Shihao Gu & Bryan Kelly & Dacheng Xiu, 2020. "Empirical Asset Pricing via Machine Learning," The Review of Financial Studies, Society for Financial Studies, vol. 33(5), pages 2223-2273.
    9. Athey, Susan & Imbens, Guido W., 2019. "Machine Learning Methods Economists Should Know About," Research Papers 3776, Stanford University, Graduate School of Business.
    10. Saurabh, Samant & Dey, Kushankur, 2020. "Unraveling the relationship between social moods and the stock market: Evidence from the United Kingdom," Journal of Behavioral and Experimental Finance, Elsevier, vol. 26(C).
    11. Araujo, Gustavo Silva & Gaglianone, Wagner Piazza, 2023. "Machine learning methods for inflation forecasting in Brazil: New contenders versus classical models," Latin American Journal of Central Banking (previously Monetaria), Elsevier, vol. 4(2).
    12. Juvenal José Duarte & Sahudy Montenegro González & José César Cruz, 2021. "Predicting Stock Price Falls Using News Data: Evidence from the Brazilian Market," Computational Economics, Springer;Society for Computational Economics, vol. 57(1), pages 311-340, January.
    13. Shihao Gu & Bryan Kelly & Dacheng Xiu, 2020. "Empirical Asset Pricing via Machine Learning," Review of Finance, European Finance Association, vol. 33(5), pages 2223-2273.
    14. Wataru Souma & Irena Vodenska & Hideaki Aoyama, 2019. "Enhanced news sentiment analysis using deep learning methods," Journal of Computational Social Science, Springer, vol. 2(1), pages 33-46, January.
    15. Susan Athey & Guido W. Imbens, 2019. "Machine Learning Methods That Economists Should Know About," Annual Review of Economics, Annual Reviews, vol. 11(1), pages 685-725, August.
    16. Christian Pierdzioch & Marian Risse, 2018. "A machine‐learning analysis of the rationality of aggregate stock market forecasts," International Journal of Finance & Economics, John Wiley & Sons, Ltd., vol. 23(4), pages 642-654, October.
    17. Anshul Agrawal & Mukta Mani & Sakshi Varshney, 2023. "Bitcoin Forecasting Performance Measurement: A Comparative Study of Econometric, Machine Learning and Artificial Intelligence-Based Models," Journal of International Commerce, Economics and Policy (JICEP), World Scientific Publishing Co. Pte. Ltd., vol. 14(02), pages 1-18, June.
    18. Deniz Ersan & Chifumi Nishioka & Ansgar Scherp, 2020. "Comparison of machine learning methods for financial time series forecasting at the examples of over 10 years of daily and hourly data of DAX 30 and S&P 500," Journal of Computational Social Science, Springer, vol. 3(1), pages 103-133, April.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Victor DeMiguel & Javier Gil-Bazo & Francisco J. Nogales & André A. P. Santos, 2021. "Can Machine Learning Help to Select Portfolios of Mutual Funds?," Working Papers 1245, Barcelona School of Economics.
    2. Andrew J. Patton & Yasin Simsek, 2023. "Generalized Autoregressive Score Trees and Forests," Papers 2305.18991, arXiv.org.
    3. Jozef Barunik & Lubos Hanus, 2022. "Learning Probability Distributions in Macroeconomics and Finance," Papers 2204.06848, arXiv.org.
    4. Hoang, Daniel & Wiegratz, Kevin, 2022. "Machine learning methods in finance: Recent applications and prospects," Working Paper Series in Economics 158, Karlsruhe Institute of Technology (KIT), Department of Economics and Management.
    5. Borup, Daniel & Christensen, Bent Jesper & Mühlbach, Nicolaj Søndergaard & Nielsen, Mikkel Slot, 2023. "Targeting predictors in random forest regression," International Journal of Forecasting, Elsevier, vol. 39(2), pages 841-868.
    6. Urmat Dzhunkeev, 2024. "Forecasting Inflation in Russia Using Gradient Boosting and Neural Networks," Russian Journal of Money and Finance, Bank of Russia, vol. 83(1), pages 53-76, March.
    7. Philippe Goulet Coulombe & Maxime Leroux & Dalibor Stevanovic & Stéphane Surprenant, 2022. "How is machine learning useful for macroeconomic forecasting?," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 37(5), pages 920-964, August.
    8. Hector F. Calvo-Pardo & Tullio Mancini & Jose Olmo, 2020. "Neural Network Models for Empirical Finance," JRFM, MDPI, vol. 13(11), pages 1-22, October.
    9. Ricardo P. Masini & Marcelo C. Medeiros & Eduardo F. Mendes, 2023. "Machine learning advances for time series forecasting," Journal of Economic Surveys, Wiley Blackwell, vol. 37(1), pages 76-111, February.
    10. Ghysels, Eric & Babii, Andrii & Chen, Xi & Kumar, Rohit, 2020. "Binary Choice with Asymmetric Loss in a Data-Rich Environment: Theory and an Application to Racial Justice," CEPR Discussion Papers 15418, C.E.P.R. Discussion Papers.
    11. Yulin Liu & Luyao Zhang, 2022. "Cryptocurrency Valuation: An Explainable AI Approach," Papers 2201.12893, arXiv.org, revised Jul 2023.
    12. Kristof Lommers & Ouns El Harzli & Jack Kim, 2021. "Confronting Machine Learning With Financial Research," Papers 2103.00366, arXiv.org, revised Mar 2021.
    13. Hanauer, Matthias X. & Kononova, Marina & Rapp, Marc Steffen, 2022. "Boosting agnostic fundamental analysis: Using machine learning to identify mispricing in European stock markets," Finance Research Letters, Elsevier, vol. 48(C).
    14. Philippe Goulet Coulombe, 2021. "To Bag is to Prune," Working Papers 21-03, Chair in macroeconomics and forecasting, University of Quebec in Montreal's School of Management, revised Jun 2021.
    15. Byron Botha & Rulof Burger & Kevin Kotzé & Neil Rankin & Daan Steenkamp, 2023. "Big data forecasting of South African inflation," Empirical Economics, Springer, vol. 65(1), pages 149-188, July.
    16. Helena Chuliá & Sabuhi Khalili & Jorge M. Uribe, 2024. "Monitoring time-varying systemic risk in sovereign debt and currency markets with generative AI," IREA Working Papers 202402, University of Barcelona, Research Institute of Applied Economics, revised Feb 2024.
    17. Zhang, Qin & Ni, He & Xu, Hao, 2023. "Nowcasting Chinese GDP in a data-rich environment: Lessons from machine learning algorithms," Economic Modelling, Elsevier, vol. 122(C).
    18. Ba Chu & Shafiullah Qureshi, 2023. "Comparing Out-of-Sample Performance of Machine Learning Methods to Forecast U.S. GDP Growth," Computational Economics, Springer;Society for Computational Economics, vol. 62(4), pages 1567-1609, December.
    19. Daniel Borup & Philippe Goulet Coulombe & Erik Christian Montes Schütte & David E. Rapach & Sander Schwenk-Nebbe, 2022. "The Anatomy of Out-of-Sample Forecasting Accuracy," FRB Atlanta Working Paper 2022-16, Federal Reserve Bank of Atlanta.
    20. Petropoulos, Fotios & Apiletti, Daniele & Assimakopoulos, Vassilios & Babai, Mohamed Zied & Barrow, Devon K. & Ben Taieb, Souhaib & Bergmeir, Christoph & Bessa, Ricardo J. & Bijak, Jakub & Boylan, Joh, 2022. "Forecasting: theory and practice," International Journal of Forecasting, Elsevier, vol. 38(3), pages 705-871.
      • Fotios Petropoulos & Daniele Apiletti & Vassilios Assimakopoulos & Mohamed Zied Babai & Devon K. Barrow & Souhaib Ben Taieb & Christoph Bergmeir & Ricardo J. Bessa & Jakub Bijak & John E. Boylan & Jet, 2020. "Forecasting: theory and practice," Papers 2012.03854, arXiv.org, revised Jan 2022.

    More about this item

    Keywords

    Finance; machine learning; deep learning; stock market;
    All these keywords.

    JEL classification:

    • C22 - Mathematical and Quantitative Methods - - Single Equation Models; Single Variables - - - Time-Series Models; Dynamic Quantile Regressions; Dynamic Treatment Effect Models; Diffusion Processes
    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods
    • G17 - Financial Economics - - General Financial Markets - - - Financial Forecasting and Simulation

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:spa:wpaper:2023wpecon13. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Pedro Garcia Duarte (email available below). General contact details of provider: https://edirc.repec.org/data/deuspbr.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.