IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v11y2023i12p2625-d1166929.html
   My bibliography  Save this article

Multi-Country and Multi-Horizon GDP Forecasting Using Temporal Fusion Transformers

Author

Listed:
  • Juan Laborda

    (Department of Business Administration, Universidad Carlos III, Getafe, 28903 Madrid, Spain)

  • Sonia Ruano

    (Banco de España, C/Alcalá 48, 28014 Madrid, Spain)

  • Ignacio Zamanillo

    (Banco de España, C/Alcalá 48, 28014 Madrid, Spain)

Abstract

This paper applies a new artificial intelligence architecture, the temporal fusion transformer (TFT), for the joint GDP forecasting of 25 OECD countries at different time horizons. This new attention-based architecture offers significant advantages over other deep learning methods. First, results are interpretable since the impact of each explanatory variable on each forecast can be calculated. Second, it allows for visualizing persistent temporal patterns and identifying significant events and different regimes. Third, it provides quantile regressions and permits training the model on multiple time series from different distributions. Results suggest that TFTs outperform regression models, especially in periods of turbulence such as the COVID-19 shock. Interesting economic interpretations are obtained depending on whether the country has domestic demand-led or export-led growth. In essence, TFT is revealed as a new tool that artificial intelligence provides to economists and policy makers, with enormous prospects for the future.

Suggested Citation

  • Juan Laborda & Sonia Ruano & Ignacio Zamanillo, 2023. "Multi-Country and Multi-Horizon GDP Forecasting Using Temporal Fusion Transformers," Mathematics, MDPI, vol. 11(12), pages 1-26, June.
  • Handle: RePEc:gam:jmathe:v:11:y:2023:i:12:p:2625-:d:1166929
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/11/12/2625/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/11/12/2625/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Frankel, Jeffrey A & Rose, Andrew K, 1998. "The Endogeneity of the Optimum Currency Area Criteria," Economic Journal, Royal Economic Society, vol. 108(449), pages 1009-1025, July.
    2. Gebhard Kirchgässner & Jürgen Wolters & Uwe Hassler, 2013. "Univariate Stationary Processes," Springer Texts in Business and Economics, in: Introduction to Modern Time Series Analysis, edition 2, chapter 2, pages 27-93, Springer.
    3. Mr. Andrew J Tiffin, 2016. "Seeing in the Dark: A Machine-Learning Approach to Nowcasting in Lebanon," IMF Working Papers 2016/056, International Monetary Fund.
    4. Dimitris Korobilis, 2013. "Var Forecasting Using Bayesian Variable Selection," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 28(2), pages 204-230, March.
    5. Terasvirta, T & Anderson, H M, 1992. "Characterizing Nonlinearities in Business Cycles Using Smooth Transition Autoregressive Models," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 7(S), pages 119-136, Suppl. De.
    6. Elena Bobeica & Paulo Esteves & António Rua & Karsten Staehr, 2016. "Exports and domestic demand pressure: a dynamic panel data model for the euro area countries," Review of World Economics (Weltwirtschaftliches Archiv), Springer;Institut für Weltwirtschaft (Kiel Institute for the World Economy), vol. 152(1), pages 107-125, February.
    7. Arturo Estrella & Frederic S. Mishkin, 1998. "Predicting U.S. Recessions: Financial Variables As Leading Indicators," The Review of Economics and Statistics, MIT Press, vol. 80(1), pages 45-61, February.
    8. 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.
    9. Jean Imbs, 2004. "Trade, Finance, Specialization, and Synchronization," The Review of Economics and Statistics, MIT Press, vol. 86(3), pages 723-734, August.
    10. Atif Mian & Amir Sufi, 2018. "Finance and Business Cycles: The Credit-Driven Household Demand Channel," Journal of Economic Perspectives, American Economic Association, vol. 32(3), pages 31-58, Summer.
    11. Amir Masoud Rahmani & Efat Yousefpoor & Mohammad Sadegh Yousefpoor & Zahid Mehmood & Amir Haider & Mehdi Hosseinzadeh & Rizwan Ali Naqvi, 2021. "Machine Learning (ML) in Medicine: Review, Applications, and Challenges," Mathematics, MDPI, vol. 9(22), pages 1-52, November.
    12. Mehmet Balcilar & Rangan Gupta & Anandamayee Majumdar & Stephen M. Miller, 2015. "Was the recent downturn in US real GDP predictable?," Applied Economics, Taylor & Francis Journals, vol. 47(28), pages 2985-3007, June.
    13. Clark, Todd E. & van Wincoop, Eric, 2001. "Borders and business cycles," Journal of International Economics, Elsevier, vol. 55(1), pages 59-85, October.
    14. Choudhry, Taufiq & Papadimitriou, Fotios I. & Shabi, Sarosh, 2016. "Stock market volatility and business cycle: Evidence from linear and nonlinear causality tests," Journal of Banking & Finance, Elsevier, vol. 66(C), pages 89-101.
    15. Simon Gilchrist & Benoit Mojon, 2018. "Credit Risk in the Euro Area," Economic Journal, Royal Economic Society, vol. 128(608), pages 118-158, February.
    16. Tarlok Singh, 2010. "Does International Trade Cause Economic Growth? A Survey," The World Economy, Wiley Blackwell, vol. 33(11), pages 1517-1564, November.
    17. Jin-Kyu Jung & Manasa Patnam & Anna Ter-Martirosyan, 2018. "An Algorithmic Crystal Ball: Forecasts-based on Machine Learning," IMF Working Papers 2018/230, International Monetary Fund.
    18. Engelbert Stockhammer, 2004. "Financialisation and the slowdown of accumulation," Cambridge Journal of Economics, Cambridge Political Economy Society, vol. 28(5), pages 719-741, September.
    19. Jon Faust & Simon Gilchrist & Jonathan H. Wright & Egon Zakrajšsek, 2013. "Credit Spreads as Predictors of Real-Time Economic Activity: A Bayesian Model-Averaging Approach," The Review of Economics and Statistics, MIT Press, vol. 95(5), pages 1501-1519, December.
    20. Antonello D'Agostino & Luca Gambetti & Domenico Giannone, 2013. "Macroeconomic forecasting and structural change," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 28(1), pages 82-101, January.
    21. Simon Gilchrist & Benoit Mojon, 2018. "Credit Risk in the Euro Area," Economic Journal, Royal Economic Society, vol. 128(608), pages 118-158, February.
    22. Banerjee, Anindya & Marcellino, Massimiliano, 2006. "Are there any reliable leading indicators for US inflation and GDP growth?," International Journal of Forecasting, Elsevier, vol. 22(1), pages 137-151.
    23. Hamilton, James D, 1989. "A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle," Econometrica, Econometric Society, vol. 57(2), pages 357-384, March.
    24. Juan Cuestas & Dean Garratt, 2011. "Is real GDP per capita a stationary process? Smooth transitions, nonlinear trends and unit root testing," Empirical Economics, Springer, vol. 41(3), pages 555-563, December.
    25. Bernanke, Ben S & Blinder, Alan S, 1992. "The Federal Funds Rate and the Channels of Monetary Transmission," American Economic Review, American Economic Association, vol. 82(4), pages 901-921, September.
    26. Camacho, Maximo & Perez-Quiros, Gabriel & Poncela, Pilar, 2018. "Markov-switching dynamic factor models in real time," International Journal of Forecasting, Elsevier, vol. 34(4), pages 598-611.
    27. Filardo, Andrew J, 1994. "Business-Cycle Phases and Their Transitional Dynamics," Journal of Business & Economic Statistics, American Statistical Association, vol. 12(3), pages 299-308, July.
    28. Gebhard Kirchgässner & Jürgen Wolters & Uwe Hassler, 2013. "Introduction to Modern Time Series Analysis," Springer Texts in Business and Economics, Springer, edition 2, number 978-3-642-33436-8, August.
    29. Hamilton, James D., 1996. "Specification testing in Markov-switching time-series models," Journal of Econometrics, Elsevier, vol. 70(1), pages 127-157, January.
    30. Heikki Kauppi & Pentti Saikkonen, 2008. "Predicting U.S. Recessions with Dynamic Binary Response Models," The Review of Economics and Statistics, MIT Press, vol. 90(4), pages 777-791, November.
    31. Christos Christodoulou-Volos & Fotios Siokis, 2006. "Long range dependence in stock market returns," Applied Financial Economics, Taylor & Francis Journals, vol. 16(18), pages 1331-1338.
    32. Hamilton, James D & Perez-Quiros, Gabriel, 1996. "What Do the Leading Indicators Lead?," The Journal of Business, University of Chicago Press, vol. 69(1), pages 27-49, January.
    33. Okimoto, Tatsuyoshi & Takaoka, Sumiko, 2022. "The credit spread curve distribution and economic fluctuations in Japan," Journal of International Money and Finance, Elsevier, vol. 122(C).
    34. Litterman, Robert B, 1986. "Forecasting with Bayesian Vector Autoregressions-Five Years of Experience," Journal of Business & Economic Statistics, American Statistical Association, vol. 4(1), pages 25-38, January.
    35. Sims, Christopher A., 1992. "Interpreting the macroeconomic time series facts : The effects of monetary policy," European Economic Review, Elsevier, vol. 36(5), pages 975-1000, June.
    36. Michael Bleaney & Paul Mizen & Veronica Veleanu, 2016. "Bond Spreads and Economic Activity in Eight European Economies," Economic Journal, Royal Economic Society, vol. 126(598), pages 2257-2291, December.
    37. Belke, Ansgar H. & Bordon, Ingo G. & Hendricks, Torben W., 2014. "Monetary policy, global liquidity and commodity price dynamics," The North American Journal of Economics and Finance, Elsevier, vol. 28(C), pages 1-16.
    38. Maximo Camacho & Gabriel Perez‐Quiros & Pilar Poncela, 2015. "Extracting Nonlinear Signals from Several Economic Indicators," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 30(7), pages 1073-1089, November.
    39. Estrella, Arturo & Hardouvelis, Gikas A, 1991. "The Term Structure as a Predictor of Real Economic Activity," Journal of Finance, American Finance Association, vol. 46(2), pages 555-576, June.
    40. Filardo, Andrew J. & Gordon, Stephen F., 1998. "Business cycle durations," Journal of Econometrics, Elsevier, vol. 85(1), pages 99-123, July.
    41. Hal R. Varian, 2014. "Big Data: New Tricks for Econometrics," Journal of Economic Perspectives, American Economic Association, vol. 28(2), pages 3-28, Spring.
    42. Koop, Gary & Korobilis, Dimitris, 2013. "Large time-varying parameter VARs," Journal of Econometrics, Elsevier, vol. 177(2), pages 185-198.
    43. Ge, Yiqing & Tang, Ke, 2020. "Commodity prices and GDP growth," International Review of Financial Analysis, Elsevier, vol. 71(C).
    44. Paulo Esteves & António Rua, 2015. "Is there a role for domestic demand pressure on export performance?," Empirical Economics, Springer, vol. 49(4), pages 1173-1189, December.
    45. Simon Gilchrist & Egon Zakrajsek, 2012. "Credit Spreads and Business Cycle Fluctuations," American Economic Review, American Economic Association, vol. 102(4), pages 1692-1720, June.
    46. Michael Bleaney & Paul Mizen & Veronica Veleanu, 2016. "Bond Spreads and Economic Activity in Eight European Economies," Economic Journal, Royal Economic Society, vol. 126(598), pages 2257-2291, December.
    47. Lim, Bryan & Arık, Sercan Ö. & Loeff, Nicolas & Pfister, Tomas, 2021. "Temporal Fusion Transformers for interpretable multi-horizon time series forecasting," International Journal of Forecasting, Elsevier, vol. 37(4), pages 1748-1764.
    48. Jaehyun Yoon, 2021. "Forecasting of Real GDP Growth Using Machine Learning Models: Gradient Boosting and Random Forest Approach," Computational Economics, Springer;Society for Computational Economics, vol. 57(1), pages 247-265, January.
    49. Hamilton, James D., 2011. "Calling recessions in real time," International Journal of Forecasting, Elsevier, vol. 27(4), pages 1006-1026, October.
    50. Bernard, Henri & Gerlach, Stefan, 1998. "Does the Term Structure Predict Recessions? The International Evidence," International Journal of Finance & Economics, John Wiley & Sons, Ltd., vol. 3(3), pages 195-215, July.
    51. Hanna Armelius & Carl-Johan Belfrage & Hanna Stenbacka, 2014. "The Mystery of the Missing Growth in World Trade after the Global Financial Crisis," EcoMod2014 6933, EcoMod.
    52. Pietro Murialdo & Linda Ponta & Anna Carbone, 2020. "Long-Range Dependence in Financial Markets: a Moving Average Cluster Entropy Approach," Papers 2004.14736, arXiv.org.
    53. Marcelle Chauvet & Simon Potter, 2005. "Forecasting recessions using the yield curve," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 24(2), pages 77-103.
    54. Gilchrist, Simon & Yankov, Vladimir & Zakrajsek, Egon, 2009. "Credit market shocks and economic fluctuations: Evidence from corporate bond and stock markets," Journal of Monetary Economics, Elsevier, vol. 56(4), pages 471-493, May.
    55. Lawrence H. Summers, 2015. "Demand Side Secular Stagnation," American Economic Review, American Economic Association, vol. 105(5), pages 60-65, May.
    56. de Soyres, François & Gaillard, Alexandre, 2022. "Global trade and GDP comovement," Journal of Economic Dynamics and Control, Elsevier, vol. 138(C).
    57. Karim Barhoumi & Olivier Darné & Laurent Ferrara, 2014. "Dynamic factor models: A review of the literature," OECD Journal: Journal of Business Cycle Measurement and Analysis, OECD Publishing, Centre for International Research on Economic Tendency Surveys, vol. 2013(2), pages 73-107.
    58. Robert E. McCulloch & Ruey S. Tsay, 1994. "Statistical Analysis Of Economic Time Series Via Markov Switching Models," Journal of Time Series Analysis, Wiley Blackwell, vol. 15(5), pages 523-539, September.
    59. Sims, Christopher A, 1980. "Macroeconomics and Reality," Econometrica, Econometric Society, vol. 48(1), pages 1-48, January.
    60. James H. Stock & Mark W.Watson, 2003. "Forecasting Output and Inflation: The Role of Asset Prices," Journal of Economic Literature, American Economic Association, vol. 41(3), pages 788-829, September.
    61. Chai, Soo H. & Lim, Joon S., 2016. "Forecasting business cycle with chaotic time series based on neural network with weighted fuzzy membership functions," Chaos, Solitons & Fractals, Elsevier, vol. 90(C), pages 118-126.
    62. Okimoto, Tatsuyoshi & Takaoka, Sumiko, 2017. "The term structure of credit spreads and business cycle in Japan," Journal of the Japanese and International Economies, Elsevier, vol. 45(C), pages 27-36.
    63. Robert E. McCulloch & Ruey S. Tsay, 1994. "Bayesian Analysis Of Autoregressive Time Series Via The Gibbs Sampler," Journal of Time Series Analysis, Wiley Blackwell, vol. 15(2), pages 235-250, March.
    64. Sendhil Mullainathan & Jann Spiess, 2017. "Machine Learning: An Applied Econometric Approach," Journal of Economic Perspectives, American Economic Association, vol. 31(2), pages 87-106, Spring.
    65. Beckmann, Joscha & Belke, Ansgar & Czudaj, Robert, 2014. "Does global liquidity drive commodity prices?," Journal of Banking & Finance, Elsevier, vol. 48(C), pages 224-234.
    66. Arturo Estrella, 2005. "Why Does the Yield Curve Predict Output and Inflation?," Economic Journal, Royal Economic Society, vol. 115(505), pages 722-744, July.
    67. Robert J. Gordon, 2012. "Is U.S. Economic Growth Over? Faltering Innovation Confronts the Six Headwinds," NBER Working Papers 18315, National Bureau of Economic Research, Inc.
    68. van Dijk, Dick & Franses, Philip Hans & Paap, Richard, 2002. "A nonlinear long memory model, with an application to US unemployment," Journal of Econometrics, Elsevier, vol. 110(2), pages 135-165, October.
    69. Harvey, Campbell R., 1988. "The real term structure and consumption growth," Journal of Financial Economics, Elsevier, vol. 22(2), pages 305-333, December.
    70. Hyman P. Minsky, 1992. "The Financial Instability Hypothesis," Economics Working Paper Archive wp_74, Levy Economics Institute.
    71. Granger, Clive W. J. & Terasvirta, Timo, 1993. "Modelling Non-Linear Economic Relationships," OUP Catalogue, Oxford University Press, number 9780198773207.
    72. Elmira Emsia & Cagay Coskuner, 2016. "Economic Growth Prediction Using Optimized Support Vector Machines," Computational Economics, Springer;Society for Computational Economics, vol. 48(3), pages 453-462, October.
    73. Robert D. Laurent, 1988. "An interest rate-based indicator of monetary policy," Economic Perspectives, Federal Reserve Bank of Chicago, vol. 12(Jan), pages 3-14.
    74. Taylor, John B., 1993. "Discretion versus policy rules in practice," Carnegie-Rochester Conference Series on Public Policy, Elsevier, vol. 39(1), pages 195-214, December.
    75. 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.
    76. Chang-Jin Kim & Charles R. Nelson, 1999. "State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications," MIT Press Books, The MIT Press, edition 1, volume 1, number 0262112388, December.
    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. Okimoto, Tatsuyoshi & Takaoka, Sumiko, 2022. "The credit spread curve distribution and economic fluctuations in Japan," Journal of International Money and Finance, Elsevier, vol. 122(C).
    2. Chauvet, Marcelle & Potter, Simon, 2013. "Forecasting Output," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 2, chapter 0, pages 141-194, Elsevier.
    3. Nakaota, Hiroshi & Fukuta, Yuichi, 2013. "The leading indicator property of the term spread and the monetary policy factors in Japan," Japan and the World Economy, Elsevier, vol. 28(C), pages 85-98.
    4. Ang, Andrew & Piazzesi, Monika & Wei, Min, 2006. "What does the yield curve tell us about GDP growth?," Journal of Econometrics, Elsevier, vol. 131(1-2), pages 359-403.
    5. Okimoto, Tatsuyoshi & Takaoka, Sumiko, 2020. "No-arbitrage determinants of credit spread curves under the unconventional monetary policy regime in Japan," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 64(C).
    6. Ibarra-Ramírez Raúl, 2021. "The Yield Curve as a Predictor of Economic Activity in Mexico: The Role of the Term Premium," Working Papers 2021-07, Banco de México.
    7. Sun, Jiandong & Feng, Shuaizhang & Hu, Yingyao, 2021. "Misclassification errors in labor force statuses and the early identification of economic recessions," Journal of Asian Economics, Elsevier, vol. 75(C).
    8. Chen, Guojin & Liu, Yanzhen & Zhang, Yu, 2021. "Systemic risk measures and distribution forecasting of macroeconomic shocks," International Review of Economics & Finance, Elsevier, vol. 75(C), pages 178-196.
    9. Mehmet Balcilar & Rangan Gupta & Anandamayee Majumdar & Stephen M. Miller, 2012. "Was the Recent Downturn in US GDP Predictable?," Working Papers 1210, University of Nevada, Las Vegas , Department of Economics.
    10. Koji Takahashi & Sumiko Takaoka, 2023. "How much do firms need to satisfy employees? - Evidence from credit spreads and online employee reviews," BIS Working Papers 1111, Bank for International Settlements.
    11. Mehmet Balcilar & Rangan Gupta & Anandamayee Majumdar & Stephen M. Miller, 2015. "Was the recent downturn in US real GDP predictable?," Applied Economics, Taylor & Francis Journals, vol. 47(28), pages 2985-3007, June.
    12. Kiss, Tamás & Nguyen, Hoang & Österholm, Pär, 2022. "The Relation between the High-Yield Bond Spread and the Unemployment Rate in the Euro Area," Finance Research Letters, Elsevier, vol. 46(PA).
    13. Deschamps, Bruno & Ioannidis, Christos & Ka, Kook, 2020. "High-frequency credit spread information and macroeconomic forecast revision," International Journal of Forecasting, Elsevier, vol. 36(2), pages 358-372.
    14. Moolman, Elna, 2004. "A Markov switching regime model of the South African business cycle," Economic Modelling, Elsevier, vol. 21(4), pages 631-646, July.
    15. Cremers, Martijn & Fleckenstein, Matthias & Gandhi, Priyank, 2021. "Treasury yield implied volatility and real activity," Journal of Financial Economics, Elsevier, vol. 140(2), pages 412-435.
    16. Elena Andreou & Eric Ghysels & Andros Kourtellos, 2013. "Should Macroeconomic Forecasters Use Daily Financial Data and How?," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 31(2), pages 240-251, April.
    17. David C. Wheelock & Mark E. Wohar, 2009. "Can the term spread predict output growth and recessions? a survey of the literature," Review, Federal Reserve Bank of St. Louis, vol. 91(Sep), pages 419-440.
    18. Hasse, Jean-Baptiste & Lajaunie, Quentin, 2022. "Does the yield curve signal recessions? New evidence from an international panel data analysis," The Quarterly Review of Economics and Finance, Elsevier, vol. 84(C), pages 9-22.
    19. Nissilä, Wilma, 2020. "Probit based time series models in recession forecasting – A survey with an empirical illustration for Finland," BoF Economics Review 7/2020, Bank of Finland.
    20. Guérin, Pierre & Leiva-Leon, Danilo, 2017. "Model averaging in Markov-switching models: Predicting national recessions with regional data," Economics Letters, Elsevier, vol. 157(C), pages 45-49.

    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:gam:jmathe:v:11:y:2023:i:12:p:2625-:d:1166929. 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: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    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.