IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2211.04752.html
   My bibliography  Save this paper

Bayesian Neural Networks for Macroeconomic Analysis

Author

Listed:
  • Niko Hauzenberger
  • Florian Huber
  • Karin Klieber
  • Massimiliano Marcellino

Abstract

Macroeconomic data is characterized by a limited number of observations (small T), many time series (big K) but also by featuring temporal dependence. Neural networks, by contrast, are designed for datasets with millions of observations and covariates. In this paper, we develop Bayesian neural networks (BNNs) that are well-suited for handling datasets commonly used for macroeconomic analysis in policy institutions. Our approach avoids extensive specification searches through a novel mixture specification for the activation function that appropriately selects the form of nonlinearities. Shrinkage priors are used to prune the network and force irrelevant neurons to zero. To cope with heteroskedasticity, the BNN is augmented with a stochastic volatility model for the error term. We illustrate how the model can be used in a policy institution by first showing that our different BNNs produce precise density forecasts, typically better than those from other machine learning methods. Finally, we showcase how our model can be used to recover nonlinearities in the reaction of macroeconomic aggregates to financial shocks.

Suggested Citation

  • Niko Hauzenberger & Florian Huber & Karin Klieber & Massimiliano Marcellino, 2022. "Bayesian Neural Networks for Macroeconomic Analysis," Papers 2211.04752, arXiv.org, revised Apr 2024.
  • Handle: RePEc:arx:papers:2211.04752
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2211.04752
    File Function: Latest version
    Download Restriction: no
    ---><---

    Other versions of this item:

    References listed on IDEAS

    as
    1. Kastner, Gregor & Frühwirth-Schnatter, Sylvia, 2014. "Ancillarity-sufficiency interweaving strategy (ASIS) for boosting MCMC estimation of stochastic volatility models," Computational Statistics & Data Analysis, Elsevier, vol. 76(C), pages 408-423.
    2. Ramsey James B. & Lampart Camille, 1998. "The Decomposition of Economic Relationships by Time Scale Using Wavelets: Expenditure and Income," Studies in Nonlinear Dynamics & Econometrics, De Gruyter, vol. 3(1), pages 1-22, April.
    3. Ivo Welch & Amit Goyal, 2008. "A Comprehensive Look at The Empirical Performance of Equity Premium Prediction," The Review of Financial Studies, Society for Financial Studies, vol. 21(4), pages 1455-1508, July.
    4. Yu Bai & Andrea Carriero & Todd E. Clark & Massimiliano Marcellino, 2022. "Macroeconomic forecasting in a multi‐country context," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 37(6), pages 1230-1255, September.
    5. Max H. Farrell & Tengyuan Liang & Sanjog Misra, 2021. "Deep Neural Networks for Estimation and Inference," Econometrica, Econometric Society, vol. 89(1), pages 181-213, January.
    6. Philippe Goulet Coulombe, 2024. "The macroeconomy as a random forest," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 39(3), pages 401-421, April.
    7. Bai, Jushan & Ng, Serena, 2013. "Principal components estimation and identification of static factors," Journal of Econometrics, Elsevier, vol. 176(1), pages 18-29.
    8. Robert F. Engle & Jose Gonzalo Rangel, 2008. "The Spline-GARCH Model for Low-Frequency Volatility and Its Global Macroeconomic Causes," The Review of Financial Studies, Society for Financial Studies, vol. 21(3), pages 1187-1222, May.
    9. Philippe Goulet Coulombe & Mikael Frenette & Karin Klieber, 2023. "From Reactive to Proactive Volatility Modeling with Hemisphere Neural Networks," Papers 2311.16333, arXiv.org, revised Apr 2024.
    10. Blix, Mårten, 1999. "Forecasting Swedish Inflation With a Markov Switching VAR," Working Paper Series 76, Sveriges Riksbank (Central Bank of Sweden).
    11. John Y. Campbell & Tuomo Vuolteenaho, 2004. "Inflation Illusion and Stock Prices," American Economic Review, American Economic Association, vol. 94(2), pages 19-23, May.
    12. 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.
    13. Gallegati, Marco, 2008. "Wavelet analysis of stock returns and aggregate economic activity," Computational Statistics & Data Analysis, Elsevier, vol. 52(6), pages 3061-3074, February.
    14. Hodrick, Robert J, 1992. "Dividend Yields and Expected Stock Returns: Alternative Procedures for Inference and Measurement," The Review of Financial Studies, Society for Financial Studies, vol. 5(3), pages 357-386.
    15. David S. Lee & Thomas Lemieux, 2010. "Regression Discontinuity Designs in Economics," Journal of Economic Literature, American Economic Association, vol. 48(2), pages 281-355, June.
    16. Anindya Bhadra & Jyotishka Datta & Yunfan Li & Nicholas Polson, 2020. "Horseshoe Regularisation for Machine Learning in Complex and Deep Models," International Statistical Review, International Statistical Institute, vol. 88(2), pages 302-320, August.
    17. Jushan Bai & Serena Ng, 2002. "Determining the Number of Factors in Approximate Factor Models," Econometrica, Econometric Society, vol. 70(1), pages 191-221, January.
    18. 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.
    19. Ilias Chronopoulos & Aristeidis Raftapostolos & George Kapetanios, 2024. "Forecasting Value-at-Risk Using Deep Neural Network Quantile Regression," Journal of Financial Econometrics, Oxford University Press, vol. 22(3), pages 636-669.
    20. Miguel A.G. Belmonte & Gary Koop & Dimitris Korobilis, 2014. "Hierarchical Shrinkage in Time‐Varying Parameter Models," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 33(1), pages 80-94, January.
    21. Carlos M. Carvalho & Nicholas G. Polson & James G. Scott, 2010. "The horseshoe estimator for sparse signals," Biometrika, Biometrika Trust, vol. 97(2), pages 465-480.
    22. Clark, Todd E. & McCracken, Michael W., 2006. "The Predictive Content of the Output Gap for Inflation: Resolving In-Sample and Out-of-Sample Evidence," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 38(5), pages 1127-1148, August.
    23. Michael W. McCracken & Serena Ng, 2016. "FRED-MD: A Monthly Database for Macroeconomic Research," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 34(4), pages 574-589, October.
    24. Ilias Chronopoulos & Katerina Chrysikou & George Kapetanios & James Mitchell & Aristeidis Raftapostolos, 2023. "Deep Neural Network Estimation in Panel Data Models," Papers 2305.19921, arXiv.org.
    25. Barbara Rossi, 2013. "Exchange Rate Predictability," Journal of Economic Literature, American Economic Association, vol. 51(4), pages 1063-1119, December.
    26. Vasicek, Oldrich A & Fong, H Gifford, 1982. "Term Structure Modeling Using Exponential Splines," Journal of Finance, American Finance Association, vol. 37(2), pages 339-348, May.
    27. Salinas, David & Flunkert, Valentin & Gasthaus, Jan & Januschowski, Tim, 2020. "DeepAR: Probabilistic forecasting with autoregressive recurrent networks," International Journal of Forecasting, Elsevier, vol. 36(3), pages 1181-1191.
    28. Todd E. Clark, 2011. "Real-Time Density Forecasts From Bayesian Vector Autoregressions With Stochastic Volatility," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 29(3), pages 327-341, July.
    29. Raffaella Giacomini & Barbara Rossi, 2010. "Forecast comparisons in unstable environments," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 25(4), pages 595-620.
    30. Florian Huber & Gary Koop & Luca Onorante, 2021. "Inducing Sparsity and Shrinkage in Time-Varying Parameter Models," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 39(3), pages 669-683, July.
    31. Daniel R. Kowal & David S. Matteson & David Ruppert, 2019. "Dynamic shrinkage processes," Journal of the Royal Statistical Society Series B, Royal Statistical Society, vol. 81(4), pages 781-804, September.
    32. Kourentzes, Nikolaos, 2013. "Intermittent demand forecasts with neural networks," International Journal of Production Economics, Elsevier, vol. 143(1), pages 198-206.
    33. Marcellino, Massimiliano & Stock, James H. & Watson, Mark W., 2006. "A comparison of direct and iterated multistep AR methods for forecasting macroeconomic time series," Journal of Econometrics, Elsevier, vol. 135(1-2), pages 499-526.
    34. Geweke, John & Amisano, Gianni, 2010. "Comparing and evaluating Bayesian predictive distributions of asset returns," International Journal of Forecasting, Elsevier, vol. 26(2), pages 216-230, April.
    35. Spyros Makridakis & Evangelos Spiliotis & Vassilios Assimakopoulos, 2018. "Statistical and Machine Learning forecasting methods: Concerns and ways forward," PLOS ONE, Public Library of Science, vol. 13(3), pages 1-26, March.
    36. McCrary, Justin, 2008. "Manipulation of the running variable in the regression discontinuity design: A density test," Journal of Econometrics, Elsevier, vol. 142(2), pages 698-714, February.
    37. Bollerslev, Tim, 1986. "Generalized autoregressive conditional heteroskedasticity," Journal of Econometrics, Elsevier, vol. 31(3), pages 307-327, April.
    38. James H. Stock & Mark W. Watson, 2007. "Why Has U.S. Inflation Become Harder to Forecast?," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 39(s1), pages 3-33, February.
    39. Trong-Nghia Nguyen & Minh-Ngoc Tran & David Gunawan & Robert Kohn, 2023. "A Statistical Recurrent Stochastic Volatility Model for Stock Markets," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 41(2), pages 414-428, April.
    40. Guido W. Imbens & Jeffrey M. Wooldridge, 2009. "Recent Developments in the Econometrics of Program Evaluation," Journal of Economic Literature, American Economic Association, vol. 47(1), pages 5-86, March.
    41. Todd E. Clark & Florian Huber & Gary Koop & Massimiliano Marcellino & Michael Pfarrhofer, 2024. "Investigating Growth-at-Risk Using a Multicountry Nonparametric Quantile Factor Model," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 42(4), pages 1302-1317, October.
    42. 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.
    43. Stock, James H. & Watson, Mark W., 1999. "Forecasting inflation," Journal of Monetary Economics, Elsevier, vol. 44(2), pages 293-335, October.
    44. Anirban Bhattacharya & Debdeep Pati & Natesh S. Pillai & David B. Dunson, 2015. "Dirichlet--Laplace Priors for Optimal Shrinkage," Journal of the American Statistical Association, Taylor & Francis Journals, vol. 110(512), pages 1479-1490, December.
    45. Ai, Chunrong & Norton, Edward C., 2003. "Interaction terms in logit and probit models," Economics Letters, Elsevier, vol. 80(1), pages 123-129, July.
    46. Stock, James H & Watson, Mark W, 2002. "Macroeconomic Forecasting Using Diffusion Indexes," Journal of Business & Economic Statistics, American Statistical Association, vol. 20(2), pages 147-162, April.
    47. John Y. Campbell, Robert J. Shiller, 1988. "The Dividend-Price Ratio and Expectations of Future Dividends and Discount Factors," The Review of Financial Studies, Society for Financial Studies, vol. 1(3), pages 195-228.
    48. George, Edward I. & Sun, Dongchu & Ni, Shawn, 2008. "Bayesian stochastic search for VAR model restrictions," Journal of Econometrics, Elsevier, vol. 142(1), pages 553-580, January.
    49. Barro, Robert J. & Lee, Jong-Wha, 1994. "Sources of economic growth," Carnegie-Rochester Conference Series on Public Policy, Elsevier, vol. 40(1), pages 1-46, June.
    50. Fama, Eugene F. & Schwert, G. William, 1977. "Asset returns and inflation," Journal of Financial Economics, Elsevier, vol. 5(2), pages 115-146, November.
    51. Campbell, John Y., 1987. "Stock returns and the term structure," Journal of Financial Economics, Elsevier, vol. 18(2), pages 373-399, June.
    52. Amisano, Gianni & Fagan, Gabriel, 2013. "Money growth and inflation: A regime switching approach," Journal of International Money and Finance, Elsevier, vol. 33(C), pages 118-145.
    53. Joscha Beckmann & Gary Koop & Dimitris Korobilis & Rainer Alexander Schüssler, 2020. "Exchange rate predictability and dynamic Bayesian learning," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 35(4), pages 410-421, June.
    54. Greene, William, 2010. "Testing hypotheses about interaction terms in nonlinear models," Economics Letters, Elsevier, vol. 107(2), pages 291-296, May.
    55. Florian Huber & Michael Pfarrhofer, 2021. "Dynamic shrinkage in time‐varying parameter stochastic volatility in mean models," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 36(2), pages 262-270, March.
    56. James H. Stock & Mark W. Watson, 2007. "Why Has U.S. Inflation Become Harder to Forecast?," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 39(s1), pages 3-33, February.
    57. 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.
    58. Lewellen, Jonathan, 2004. "Predicting returns with financial ratios," Journal of Financial Economics, Elsevier, vol. 74(2), pages 209-235, November.
    59. A. Bhattacharya & D. B. Dunson, 2011. "Sparse Bayesian infinite factor models," Biometrika, Biometrika Trust, vol. 98(2), pages 291-306.
    60. 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.
    61. 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.
    62. Fama, Eugene F. & French, Kenneth R., 1988. "Dividend yields and expected stock returns," Journal of Financial Economics, Elsevier, vol. 22(1), pages 3-25, October.
    63. James H. Stock & Mark W. Watson, 2007. "Why Has U.S. Inflation Become Harder to Forecast?," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 39(s1), pages 3-33, February.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Hauzenberger, Niko & Huber, Florian & Klieber, Karin & Marcellino, Massimiliano, 2025. "Machine learning the macroeconomic effects of financial shocks," Economics Letters, Elsevier, vol. 250(C).
    2. Bobeica, Elena & Holton, Sarah & Huber, Florian & Martínez Hernández, Catalina, 2025. "Beware of large shocks! A non-parametric structural inflation model," Working Paper Series 3052, European Central Bank.

    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. Hauzenberger, Niko & Huber, Florian & Klieber, Karin, 2023. "Real-time inflation forecasting using non-linear dimension reduction techniques," International Journal of Forecasting, Elsevier, vol. 39(2), pages 901-921.
    2. Philippe Goulet Coulombe & Mikael Frenette & Karin Klieber, 2023. "From Reactive to Proactive Volatility Modeling with Hemisphere Neural Networks," Papers 2311.16333, arXiv.org, revised Apr 2024.
    3. Pfarrhofer, Michael, 2022. "Modeling tail risks of inflation using unobserved component quantile regressions," Journal of Economic Dynamics and Control, Elsevier, vol. 143(C).
    4. Michael Pfarrhofer, 2024. "Forecasts with Bayesian vector autoregressions under real time conditions," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 43(3), pages 771-801, April.
    5. Bae, Juhee, 2024. "Factor-augmented forecasting in big data," International Journal of Forecasting, Elsevier, vol. 40(4), pages 1660-1688.
    6. Rapach, David & Zhou, Guofu, 2013. "Forecasting Stock Returns," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 2, chapter 0, pages 328-383, Elsevier.
    7. 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.
    8. Nima Nonejad, 2021. "An Overview Of Dynamic Model Averaging Techniques In Time‐Series Econometrics," Journal of Economic Surveys, Wiley Blackwell, vol. 35(2), pages 566-614, April.
    9. 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.
    10. 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).
    11. Hauzenberger, Niko, 2021. "Flexible Mixture Priors for Large Time-varying Parameter Models," Econometrics and Statistics, Elsevier, vol. 20(C), pages 87-108.
    12. Martin, Gael M. & Frazier, David T. & Maneesoonthorn, Worapree & Loaiza-Maya, Rubén & Huber, Florian & Koop, Gary & Maheu, John & Nibbering, Didier & Panagiotelis, Anastasios, 2024. "Bayesian forecasting in economics and finance: A modern review," International Journal of Forecasting, Elsevier, vol. 40(2), pages 811-839.
    13. Huber, Florian & Onorante, Luca & Pfarrhofer, Michael, 2024. "Forecasting euro area inflation using a huge panel of survey expectations," International Journal of Forecasting, Elsevier, vol. 40(3), pages 1042-1054.
    14. Niko Hauzenberger, 2020. "Flexible Mixture Priors for Large Time-varying Parameter Models," Papers 2006.10088, arXiv.org, revised Nov 2020.
    15. Davide Pettenuzzo & Francesco Ravazzolo, 2016. "Optimal Portfolio Choice Under Decision‐Based Model Combinations," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 31(7), pages 1312-1332, November.
    16. Matei Demetrescu & Christoph Hanck & Robinson Kruse‐Becher, 2022. "Robust inference under time‐varying volatility: A real‐time evaluation of professional forecasters," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 37(5), pages 1010-1030, August.
    17. Richard Schnorrenberger & Aishameriane Schmidt & Guilherme Valle Moura, 2024. "Harnessing Machine Learning for Real-Time Inflation Nowcasting," Working Papers 806, DNB.
    18. 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.
    19. Dladla, Pholile & Malikane, Christopher, 2019. "Stock return predictability: Evidence from a structural model," International Review of Economics & Finance, Elsevier, vol. 59(C), pages 412-424.
    20. Gael M. Martin & David T. Frazier & Ruben Loaiza-Maya & Florian Huber & Gary Koop & John Maheu & Didier Nibbering & Anastasios Panagiotelis, 2023. "Bayesian Forecasting in the 21st Century: A Modern Review," Monash Econometrics and Business Statistics Working Papers 1/23, Monash University, Department of Econometrics and Business Statistics.

    More about this item

    JEL classification:

    • C11 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods and Methodology: General - - - Bayesian Analysis: General
    • C30 - Mathematical and Quantitative Methods - - Multiple or Simultaneous Equation Models; Multiple Variables - - - General
    • 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
    • E3 - Macroeconomics and Monetary Economics - - Prices, Business Fluctuations, and Cycles
    • E44 - Macroeconomics and Monetary Economics - - Money and Interest Rates - - - Financial Markets and the Macroeconomy

    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:arx:papers:2211.04752. 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: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    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.