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

Machine Learning Methods for Multi-Horizon Inflation Forecasting: A Comparative Analysis for Costa Rica

Author

Listed:
  • Esteban Sánchez-Gómez

    (Economic Division, Central Bank of Costa Rica)

Abstract

This paper evaluates the performance of machine learning (ML) methods for forecasting year-over-year inflation in Costa Rica using monthly data from 2012-2025 and compares their performance against standard benchmarks within a rolling out-of-sample framework. ML techniques are particularly useful for capturing nonlinearities and complex interactions between inflation and a broad set of macroeconomic covariates. The results show that nonlinear ensemble methods such as XGBoost and BART provide the strongest gains at short horizons, while linear shrinkage methods are more competitive at longer horizons. ***Resumen: Este documento evalúa el desempeño de los métodos de aprendizaje automático (ML) para pronosticar la inflación interanual en Costa Rica, utilizando datos mensuales de 2012 a 2025 y comparándolos con estándares de referencia dentro de un esquema de muestra móvil fuera de muestra. Las técnicas de ML son especialmente útiles para captar no linealidades e interacciones complejas entre la inflación y un amplio conjunto de variables macroeconómicas. Los resultados muestran que los métodos de ensamblaje no lineal como XGBoost y BART presentan los mayores beneficios en horizontes cortos, mientras que los métodos de reducción lineal son más competitivos en horizontes largos.

Suggested Citation

  • Esteban Sánchez-Gómez, 2026. "Machine Learning Methods for Multi-Horizon Inflation Forecasting: A Comparative Analysis for Costa Rica," Documentos de Trabajo 2606, Banco Central de Costa Rica.
  • Handle: RePEc:apk:doctra:2606
    as

    Download full text from publisher

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

    References listed on IDEAS

    as
    1. 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.
    2. Hui Zou & Trevor Hastie, 2005. "Addendum: Regularization and variable selection via the elastic net," Journal of the Royal Statistical Society Series B, Royal Statistical Society, vol. 67(5), pages 768-768, November.
    3. Medeiros, Marcelo C. & Vasconcelos, Gabriel F.R., 2016. "Forecasting macroeconomic variables in data-rich environments," Economics Letters, Elsevier, vol. 138(C), pages 50-52.
    4. Huber, Florian & Koop, Gary & Onorante, Luca & Pfarrhofer, Michael & Schreiner, Josef, 2023. "Nowcasting in a pandemic using non-parametric mixed frequency VARs," Journal of Econometrics, Elsevier, vol. 232(1), pages 52-69.
    5. Inoue, Atsushi & Kilian, Lutz, 2008. "How Useful Is Bagging in Forecasting Economic Time Series? A Case Study of U.S. Consumer Price Inflation," Journal of the American Statistical Association, American Statistical Association, vol. 103, pages 511-522, June.
    6. Diebold, Francis X & Mariano, Roberto S, 2002. "Comparing Predictive Accuracy," Journal of Business & Economic Statistics, American Statistical Association, vol. 20(1), pages 134-144, January.
    7. Katharine G. Abraham & Ron S. Jarmin & Brian Moyer & Matthew D. Shapiro, 2022. "Big Data for Twenty-First-Century Economic Statistics," NBER Books, National Bureau of Economic Research, Inc, number abra-7.
    8. Magazzino, Cosimo & Mele, Marco & Mutascu, Mihai, 2025. "An artificial neural network experiment on the prediction of the unemployment rate," Journal of Policy Modeling, Elsevier, vol. 47(3), pages 471-491.
    9. 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).
    10. Kian Tehranian, 2023. "Can Machine Learning Catch Economic Recessions Using Economic and Market Sentiments?," Papers 2308.16200, arXiv.org.
    11. Abraham, Katharine G. & Jarmin, Ron S. & Moyer, Brian C. & Shapiro, Matthew D. (ed.), 2022. "Big Data for Twenty-First-Century Economic Statistics," National Bureau of Economic Research Books, University of Chicago Press, edition 1, number 9780226801254, August.
    12. Florian Huber & Luca Rossini, 2020. "Inference in Bayesian Additive Vector Autoregressive Tree Models," Papers 2006.16333, arXiv.org, revised Mar 2021.
    13. Hui Zou & Trevor Hastie, 2005. "Regularization and variable selection via the elastic net," Journal of the Royal Statistical Society Series B, Royal Statistical Society, vol. 67(2), pages 301-320, April.
    14. Rickard Nyman & Paul Ormerod, 2017. "Predicting Economic Recessions Using Machine Learning Algorithms," Papers 1701.01428, arXiv.org.
    15. Giovanni Cicceri & Giuseppe Inserra & Michele Limosani, 2020. "A Machine Learning Approach to Forecast Economic Recessions—An Italian Case Study," Mathematics, MDPI, vol. 8(2), pages 1-20, February.
    16. Yang Liu & Ran Pan & Rui Xu, 2024. "Mending the Crystal Ball: Enhanced Inflation Forecasts with Machine Learning," IMF Working Papers 2024/206, International Monetary Fund.
    17. Marcelo C. Medeiros & Gabriel F. R. Vasconcelos & Álvaro Veiga & Eduardo Zilberman, 2021. "Forecasting Inflation in a Data-Rich Environment: The Benefits of Machine Learning Methods," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 39(1), pages 98-119, January.
    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. 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.
    2. Richard Schnorrenberger & Aishameriane Schmidt & Guilherme Valle Moura, 2024. "Harnessing Machine Learning for Real-Time Inflation Nowcasting," Working Papers 806, DNB.
    3. Cepni, Oguzhan & Clements, Michael P., 2024. "How local is the local inflation factor? Evidence from emerging European countries," International Journal of Forecasting, Elsevier, vol. 40(1), pages 160-183.
    4. Juan Tenorio & Wilder Perez, 2024. "Monthly GDP nowcasting with Machine Learning and Unstructured Data," Papers 2402.04165, arXiv.org.
    5. Fausch, Jürg & Frigg, Moreno & Ruenzi, Stefan & Weigert, Florian, 2026. "Machine learning mutual fund flows," CFR Working Papers 26-03, University of Cologne, Centre for Financial Research (CFR).
    6. Hauzenberger, Niko & Huber, Florian & Klieber, Karin & Marcellino, Massimiliano, 2025. "Bayesian neural networks for macroeconomic analysis," Journal of Econometrics, Elsevier, vol. 249(PC).
    7. Kim, Hyun Hak & Swanson, Norman R., 2018. "Mining big data using parsimonious factor, machine learning, variable selection and shrinkage methods," International Journal of Forecasting, Elsevier, vol. 34(2), pages 339-354.
    8. Chuliá, Helena & Garrón, Ignacio & Uribe, Jorge M., 2024. "Daily growth at risk: Financial or real drivers? The answer is not always the same," International Journal of Forecasting, Elsevier, vol. 40(2), pages 762-776.
    9. Joseph, Andreas & Potjagailo, Galina & Chakraborty, Chiranjit & Kapetanios, George, 2024. "Forecasting UK inflation bottom up," International Journal of Forecasting, Elsevier, vol. 40(4), pages 1521-1538.
    10. Адилханова Зарина // Adilkhanova Zarina & Ержан Ислам // Yerzhan Islam, 2024. "Система селективно - комбинированного прогноза инфляции (SSCIF)// Selective-Combined Inflation Forecasting System," Working Papers #2024-13, National Bank of Kazakhstan.
    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. Magnus Reif, 2020. "Macroeconomics, Nonlinearities, and the Business Cycle," ifo Beiträge zur Wirtschaftsforschung, ifo Institute - Leibniz Institute for Economic Research at the University of Munich, number 87, September.
    13. d'Aspremont, Alexandre & Ben Arous, Simon & Bricongne, Jean-Charles & Lietti, Benjamin & Meunier, Baptiste, 2025. "Satellites turn “concrete”: Tracking cement with satellite data and neural networks," Journal of Econometrics, Elsevier, vol. 249(PC).
    14. Ádám Csápai, 0000. "Macroeconomic Forecasting Using Machine Learning: A Case of Slovakia," Proceedings of Economics and Finance Conferences 14115967, International Institute of Social and Economic Sciences.
    15. Dennis Kant & Andreas Pick & Jasper de Winter, 2025. "Nowcasting GDP using machine learning methods," AStA Advances in Statistical Analysis, Springer;German Statistical Society, vol. 109(1), pages 1-24, March.
    16. 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.
    17. Todd E. Clark & Florian Huber & Gary Koop & Massimiliano Marcellino & Michael Pfarrhofer, 2023. "Tail Forecasting With Multivariate Bayesian Additive Regression Trees," International Economic Review, Department of Economics, University of Pennsylvania and Osaka University Institute of Social and Economic Research Association, vol. 64(3), pages 979-1022, August.
    18. Soňa Benecká, 2026. "Forecasting Disaggregated Producer Prices: A Fusion of Machine Learning and Econometric Techniques," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 45(5), pages 2458-2501, August.
    19. Maehashi, Kohei & Shintani, Mototsugu, 2020. "Macroeconomic forecasting using factor models and machine learning: an application to Japan," Journal of the Japanese and International Economies, Elsevier, vol. 58(C).
    20. Daniel Borup & Erik Christian Montes Schütte, 2022. "In Search of a Job: Forecasting Employment Growth Using Google Trends," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 40(1), pages 186-200, January.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    JEL classification:

    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods
    • C33 - Mathematical and Quantitative Methods - - Multiple or Simultaneous Equation Models; Multiple Variables - - - Models with Panel Data; Spatio-temporal Models

    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:apk:doctra:2606. 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.