IDEAS home Printed from https://ideas.repec.org/p/apk/doctra/2002.html

Forecasting Costa Rican Inflation with Machine Learning Methods

Author

Listed:
  • Adolfo Rodríguez-Vargas

    (Department of Economic Research, Central Bank of Costa Rica)

Abstract

We present a first assessment of the predictive ability of machine learning methods for inflation forecasting in Costa Rica. We compute forecasts using two variants of K-Nearest Neighbours, random forests, extreme gradient boosting and a long short-term memory (LSTM) network. We evaluate their properties according to criteria from the optimal forecast literature, and we compare their performance with that of an average of univariate inflation forecasts currently used by the Central Bank of Costa Rica. We find that the best-performing forecasts are those of LSTM, univariate KNN and in lesser extent random forests. Furthermore, a combination performs better than the individual forecasts included in it and the average of the univariate forecasts. This combination is unbiased, its forecast errors show appropriate properties, and it improves the forecast accuracy at all horizons, both for the level of inflation and for the direction of its changes. ***Resumen: Se presenta una primera evaluación de la capacidad de métodos de aprendizaje automático para predecir la inflación en Costa Rica. Se calculan pronósticos mediante dos variantes de K-Nearest Neighbours (KNN), bosques aleatorios, extreme gradient boosting y un modelo de tipo long short-term memory (LSTM). Sus propiedades se evalúan de acuerdo con criterios sugeridos en la literatura sobre pronósticos óptimos, se compara su desempeño con el del promedio de los pronósticos univariados actualmente en uso en el Banco Central de Costa Rica. Los resultados son promisorios. Se encontró que los pronósticos con el mejor desempeño son los resultantes de aplicar LSTM, KNN univariado y en menor medida bosques aleatorios. Además, una combinación de los pronósticos obtenidos mediante estos métodos mejora el desempeño con respecto a los pronósticos individuales a todos los horizontes, y también supera en desempeño al promedio de los pronósticos univariados. La combinación resulta insesgada, sus errores de pronóstico no muestran patrones de correlación indeseables, y mejora la capacidad de pronóstico a todos los horizontes, tanto para el nivel de la inflación como para la dirección de sus cambios.

Suggested Citation

  • Adolfo Rodríguez-Vargas, 2020. "Forecasting Costa Rican Inflation with Machine Learning Methods," Documentos de Trabajo 2002, Banco Central de Costa Rica.
  • Handle: RePEc:apk:doctra:2002
    as

    Download full text from publisher

    File URL: https://repositorioinvestigaciones.bccr.fi.cr/handle/20.500.12506/335
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. 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.
    2. Athey, Susan & Imbens, Guido W., 2019. "Machine Learning Methods Economists Should Know About," Research Papers 3776, Stanford University, Graduate School of Business.
    3. Norman R. Swanson & Halbert White, 1997. "A Model Selection Approach To Real-Time Macroeconomic Forecasting Using Linear Models And Artificial Neural Networks," The Review of Economics and Statistics, MIT Press, vol. 79(4), pages 540-550, November.
    4. Jacob A. Mincer & Victor Zarnowitz, 1969. "The Evaluation of Economic Forecasts," NBER Chapters, in: Economic Forecasts and Expectations: Analysis of Forecasting Behavior and Performance, pages 3-46, National Bureau of Economic Research, Inc.
    5. Harvey, David & Leybourne, Stephen & Newbold, Paul, 1997. "Testing the equality of prediction mean squared errors," International Journal of Forecasting, Elsevier, vol. 13(2), pages 281-291, June.
    6. Lisi, Francesco & Schiavo, Rosa A., 1999. "A comparison between neural networks and chaotic models for exchange rate prediction," Computational Statistics & Data Analysis, Elsevier, vol. 30(1), pages 87-102, March.
    7. Diebold, Francis X. & Nason, James A., 1990. "Nonparametric exchange rate prediction?," Journal of International Economics, Elsevier, vol. 28(3-4), pages 315-332, May.
    8. Patrick Bajari & Denis Nekipelov & Stephen P. Ryan & Miaoyu Yang, 2015. "Machine Learning Methods for Demand Estimation," American Economic Review, American Economic Association, vol. 105(5), pages 481-485, May.
    9. Nowman, K. Ben & Saltoglu, Burak, 2003. "Continuous time and nonparametric modelling of U.S. interest rate models," International Review of Financial Analysis, Elsevier, vol. 12(1), pages 25-34.
    10. S. Yakowitz, 1987. "Nearest‐Neighbour Methods For Time Series Analysis," Journal of Time Series Analysis, Wiley Blackwell, vol. 8(2), pages 235-247, March.
    11. Steven Gonzalez, "undated". "Neural Networks for Macroeconomic Forecasting: A Complementary Approach to Linear Regression Models," Working Papers-Department of Finance Canada 2000-07, Department of Finance Canada.
    12. Fernandez-Rodriguez, Fernando & Gonzalez-Martel, Christian & Sosvilla-Rivero, Simon, 2000. "On the profitability of technical trading rules based on artificial neural networks:: Evidence from the Madrid stock market," Economics Letters, Elsevier, vol. 69(1), pages 89-94, October.
    13. Fernandez-Rodriguez, Fernando & Sosvilla-Rivero, Simon & Andrada-Felix, Julian, 1999. "Exchange-rate forecasts with simultaneous nearest-neighbour methods: evidence from the EMS," International Journal of Forecasting, Elsevier, vol. 15(4), pages 383-392, October.
    14. Agnon, Yehuda & Golan, Amos & Shearer, Matthew, 1999. "Nonparametric, nonlinear, short-term forecasting: theory and evidence for nonlinearities in the commodity markets," Economics Letters, Elsevier, vol. 65(3), pages 293-299, December.
    15. Cumby, Robert E & Huizinga, John, 1992. "Testing the Autocorrelation Structure of Disturbances in Ordinary Least Squares and Instrumental Variables Regressions," Econometrica, Econometric Society, vol. 60(1), pages 185-195, January.
    16. Yock Y. Chong & David F. Hendry, 1986. "Econometric Evaluation of Linear Macro-Economic Models," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 53(4), pages 671-690.
    17. Nikolopoulos, Konstantinos I. & Babai, M. Zied & Bozos, Konstantinos, 2016. "Forecasting supply chain sporadic demand with nearest neighbor approaches," International Journal of Production Economics, Elsevier, vol. 177(C), pages 139-148.
    18. Mizrach, B, 1992. "Multivariate Nearest-Neighbor Forecasts of EMS Exchange Rates," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 7(S), pages 151-163, Suppl. De.
    19. Swanson, Norman R & White, Halbert, 1995. "A Model-Selection Approach to Assessing the Information in the Term Structure Using Linear Models and Artificial Neural Networks," Journal of Business & Economic Statistics, American Statistical Association, vol. 13(3), pages 265-275, July.
    20. Olivier BIAU & Angela D´ELIA, 2010. "Euro Area GDP Forecast Using Large Survey Dataset - A Random Forest Approach," EcoMod2010 259600029, EcoMod.
    21. Jing Zeng, 2017. "Forecasting Aggregates with Disaggregate Variables: Does Boosting Help to Select the Most Relevant Predictors?," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 36(1), pages 74-90, January.
    22. James H. Stock & Mark W. Watson, 1998. "A Comparison of Linear and Nonlinear Univariate Models for Forecasting Macroeconomic Time Series," NBER Working Papers 6607, National Bureau of Economic Research, Inc.
    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. Rodríguez-Vargas, Adolfo, 2020. "Forecasting Costa Rican inflation with machine learning methods," Latin American Journal of Central Banking (previously Monetaria), Elsevier, vol. 1(1).
    2. Kück, Mirko & Freitag, Michael, 2021. "Forecasting of customer demands for production planning by local k-nearest neighbor models," International Journal of Production Economics, Elsevier, vol. 231(C).
    3. McCracken,M.W. & West,K.D., 2001. "Inference about predictive ability," Working papers 14, Wisconsin Madison - Social Systems.
    4. McCracken, Michael W., 2007. "Asymptotics for out of sample tests of Granger causality," Journal of Econometrics, Elsevier, vol. 140(2), pages 719-752, October.
    5. Alberto Vindas-Quesada & Carlos Brenes-Soto & Adriana Sandí-Esquivel & Susan Jiménez-Montero, 2024. "Univariate inflation forecasts in Costa Rica: model evaluation and selection," Notas Técnicas 2405, Banco Central de Costa Rica.
    6. Haider, Adnan & Hanif, Muhammad Nadeem, 2007. "Inflation Forecasting in Pakistan using Artificial Neural Networks," MPRA Paper 14645, University Library of Munich, Germany.
    7. Clark, Todd E. & McCracken, Michael W., 2001. "Tests of equal forecast accuracy and encompassing for nested models," Journal of Econometrics, Elsevier, vol. 105(1), pages 85-110, November.
    8. Clements, Michael P. & Franses, Philip Hans & Swanson, Norman R., 2004. "Forecasting economic and financial time-series with non-linear models," International Journal of Forecasting, Elsevier, vol. 20(2), pages 169-183.
    9. Angelos Kanas, 2003. "Non-linear forecasts of stock returns," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 22(4), pages 299-315.
    10. Arora Siddharth & Little Max A. & McSharry Patrick E., 2013. "Nonlinear and nonparametric modeling approaches for probabilistic forecasting of the US gross national product," Studies in Nonlinear Dynamics & Econometrics, De Gruyter, vol. 17(4), pages 395-420, September.
    11. 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.
    12. Adolfo Rodríguez-Vargas, 2019. "Univariate Forecasts for Costa Rican Inflation With Stochastic Volatility and GARCH Effects," Documentos de Trabajo 1604, Banco Central de Costa Rica.
    13. Nakamura, Emi, 2005. "Inflation forecasting using a neural network," Economics Letters, Elsevier, vol. 86(3), pages 373-378, March.
    14. Dbouk, Wassim & Jamali, Ibrahim, 2018. "Predicting daily oil prices: Linear and non-linear models," Research in International Business and Finance, Elsevier, vol. 46(C), pages 149-165.
    15. Lahiri, Kajal & Yang, Liu, 2013. "Forecasting Binary Outcomes," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 2, chapter 0, pages 1025-1106, Elsevier.
    16. F. FernAndez-RodrIguez & S. Sosvilla-Rivero & J. Andrada-FElix, 2003. "Technical analysis in foreign exchange markets: evidence from the EMS," Applied Financial Economics, Taylor & Francis Journals, vol. 13(2), pages 113-122.
    17. Rossi, Barbara, 2013. "Advances in Forecasting under Instability," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 2, chapter 0, pages 1203-1324, Elsevier.
    18. repec:lan:wpaper:470 is not listed on IDEAS
    19. Vito Polito & Yunyi Zhang, 2021. "Tackling Large Outliers in Macroeconomic Data with Vector Artificial Neural Network Autoregression," CESifo Working Paper Series 9395, CESifo.
    20. Cao, Liangyue & Soofi, Abdol S., 1999. "Nonlinear deterministic forecasting of daily dollar exchange rates," International Journal of Forecasting, Elsevier, vol. 15(4), pages 421-430, October.
    21. Pablo Guerróon‐Quintana & Molin Zhong, 2023. "Macroeconomic forecasting in times of crises," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 38(3), pages 295-320, April.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    JEL classification:

    • E31 - Macroeconomics and Monetary Economics - - Prices, Business Fluctuations, and Cycles - - - Price Level; Inflation; Deflation
    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C49 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Other
    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods

    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:apk:doctra:2002. 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: Departamento de Investigación Económica (email available below). General contact details of provider: https://edirc.repec.org/data/bccrrcr.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.