IDEAS home Printed from https://ideas.repec.org/a/spr/compst/v41y2026i2d10.1007_s00180-026-01716-8.html

Bayesian model averaging for VAR models: gretl-based implementation

Author

Listed:
  • Marcin Błażejowski

    (WSB Merito University Torun, Faculty of Economics and Finance)

  • Paweł Kufel

    (WSB Merito University Torun, Faculty of Economics and Finance)

  • Jacek Kwiatkowski

    (Nicolaus Copernicus University, Faculty of Economic Sciences and Management)

Abstract

We combine Bayesian Model Averaging (BMA) with Vector Autoregressive (VAR) models—two widely used econometric tools. A key novelty of this study is the integration of these methods within the gretl framework. Bayesian Model Averaging has a well-established foundation in econometrics and has been extensively studied in the literature (e.g., Kass and Raftery (J Am Stat Assoc 90(430):773–795, 1995, https://doi.org/10.1080/01621459.1995.10476572 ), Raftery (Sociol Methodol 25:111–163, 1995), Raftery (Biometrika 83(2):251–266, 1996, https://doi.org/10.1093/biomet/83.2.251 ), Fernández et al. (J Econom 100(2):381–427, 2001a, https://doi.org/10.1016/S0304-4076(00)00076-2 ), Fernández et al. (J Appl Econom 16(5):563–576, 2001b, https://doi.org/10.1002/jae.623 ), Ley and Steel (J Macroecon 29(3):476–493, 2007, https://doi.org/10.1016/j.jmacro.2006.12.002 ), Ley and Steel (J Appl Economet 24(4):651–674, 2009, https://doi.org/10.1002/jae.1057 ), Steel (J Econ Lit 58(3):644–719, 2020, https://doi.org/10.1257/jel.20191385 ). BMA addresses model uncertainty by averaging over a set of competing models, weighting each model’s contribution by its explanatory power. We adopt natural conjugate priors, allowing for closed-form calculations of marginal data densities—an essential component in assessing model fit. This approach enables efficient model comparison and selection.VAR models, in turn, are a fundamental class of multivariate time series models used to capture dynamic inter-dependencies among multiple economic or financial variables (Koop and Korobilis in Found Trends® Econom 3(4):267–358, 2010a, https://doi.org/10.1561/0800000013 ; (Karlsson in: Handbook of economic forecasting, 791–897, 2013, https://doi.org/10.1016/B978-0-444-62731-5.00015-4 ). As an empirical illustration, we demonstrate the functionality of the package and assess its computational performance using a small-scale model drawn from Giannone et al. (Rev Econ Stat 97(2):436–451, 2015). The model includes three monetary variables: real GDP, the GDP deflator, and the federal funds rate. We present standard BMA outputs, including posterior inclusion probabilities, average parameter estimates, forecasts, and impulse response functions–core components of VAR model analysis. Combined with our implementation of marginal data density calculations, adapted from the original MATLAB code in Giannone et al. (Rev Econ Stat 97(2):436–451, 2015), our solution enables highly efficient computation.

Suggested Citation

  • Marcin Błażejowski & Paweł Kufel & Jacek Kwiatkowski, 2026. "Bayesian model averaging for VAR models: gretl-based implementation," Computational Statistics, Springer, vol. 41(2), pages 1-19, February.
  • Handle: RePEc:spr:compst:v:41:y:2026:i:2:d:10.1007_s00180-026-01716-8
    DOI: 10.1007/s00180-026-01716-8
    as

    Download full text from publisher

    File URL: http://link.springer.com/10.1007/s00180-026-01716-8
    File Function: Abstract
    Download Restriction: Access to the full text of the articles in this series is restricted.

    File URL: https://libkey.io/10.1007/s00180-026-01716-8?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to

    for a different version of it.

    References listed on IDEAS

    as
    1. Dimitris Korobilis, 2013. "Var Forecasting Using Bayesian Variable Selection," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 28(2), pages 204-230, March.
    2. Marta Banbura & Domenico Giannone & Lucrezia Reichlin, 2010. "Large Bayesian vector auto regressions," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 25(1), pages 71-92.
    3. Carmen Fernandez & Eduardo Ley & Mark F. J. Steel, 2001. "Model uncertainty in cross-country growth regressions," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 16(5), pages 563-576.
    4. Giovanni Baiocchi & Walter Distaso, 2003. "GRETL: Econometric software for the GNU generation," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 18(1), pages 105-110.
    5. Fernandez, Carmen & Ley, Eduardo & Steel, Mark F. J., 2001. "Benchmark priors for Bayesian model averaging," Journal of Econometrics, Elsevier, vol. 100(2), pages 381-427, February.
    6. Anabel Forte & Gonzalo Garcia‐Donato & Mark Steel, 2018. "Methods and Tools for Bayesian Variable Selection and Model Averaging in Normal Linear Regression," International Statistical Review, International Statistical Institute, vol. 86(2), pages 237-258, August.
    7. Domenico Giannone & Michele Lenza & Giorgio E. Primiceri, 2015. "Prior Selection for Vector Autoregressions," The Review of Economics and Statistics, MIT Press, vol. 97(2), pages 436-451, May.
    8. Kilian, Lutz, 2022. "Facts and fiction in oil market modeling," Energy Economics, Elsevier, vol. 110(C).
    9. Jesús Crespo Cuaresma & Martin Feldkircher & Florian Huber, 2016. "Forecasting with Global Vector Autoregressive Models: a Bayesian Approach," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 31(7), pages 1371-1391, November.
    10. Koop, Gary & Korobilis, Dimitris, 2010. "Bayesian Multivariate Time Series Methods for Empirical Macroeconomics," Foundations and Trends(R) in Econometrics, now publishers, vol. 3(4), pages 267-358, July.
    11. Ben S. Bernanke & Jean Boivin & Piotr Eliasz, 2005. "Measuring the Effects of Monetary Policy: A Factor-Augmented Vector Autoregressive (FAVAR) Approach," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 120(1), pages 387-422.
    12. Giovanni Ballarin, 2025. "Ridge regularized estimation of VAR models for inference," Journal of Time Series Analysis, Wiley Blackwell, vol. 46(2), pages 235-257, March.
    13. repec:ulb:ulbeco:2013/13388 is not listed on IDEAS
    14. Rant, Vasja & Puc, Anja & Čok, Mitja & Verbič, Miroslav, 2024. "Macroeconomic impacts of monetary and fiscal policy in the euro area in times of shifting policies: A SVAR approach," Finance Research Letters, Elsevier, vol. 64(C).
    15. Luca Pedini, 2024. "Tips and tricks for Bayesian VAR models in gretl," Computational Statistics, Springer, vol. 39(7), pages 3579-3597, December.
    16. Błażejowski, Marcin & Kwiatkowski, Jacek, 2015. "Bayesian Model Averaging and Jointness Measures for gretl," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 68(i05).
    17. H. D. Vinod & B. D. McCullough, 1999. "Corrigenda: The Numerical Reliability of Econometric Software," Journal of Economic Literature, American Economic Association, vol. 37(4), pages 1565-1565, December.
    18. A. Talha Yalta & Riccardo Lucchetti, 2008. "The GNU|Linux platform and freedom respecting software for economists," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 23(2), pages 279-286.
    19. Christopher A. Sims, 1993. "A Nine-Variable Probabilistic Macroeconomic Forecasting Model," NBER Chapters, in: Business Cycles, Indicators, and Forecasting, pages 179-212, National Bureau of Economic Research, Inc.
    20. Gruber, Luis & Kastner, Gregor, 2025. "Forecasting macroeconomic data with Bayesian VARs: Sparse or dense? It depends!," International Journal of Forecasting, Elsevier, vol. 41(4), pages 1589-1619.
    21. Zeugner, Stefan & Feldkircher, Martin, 2015. "Bayesian Model Averaging Employing Fixed and Flexible Priors: The BMS Package for R," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 68(i04).
    22. Kadiyala, K Rao & Karlsson, Sune, 1997. "Numerical Methods for Estimation and Inference in Bayesian VAR-Models," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 12(2), pages 99-132, March-Apr.
    23. Karlsson, Sune, 2013. "Forecasting with Bayesian Vector Autoregression," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 2, chapter 0, pages 791-897, Elsevier.
    24. Joshua C. C. Chan & Eric Eisenstat, 2018. "Bayesian model comparison for time‐varying parameter VARs with stochastic volatility," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 33(4), pages 509-532, June.
    25. Rubaszek, Michał & Szafranek, Karol, 2025. "Modelling oil consumption in Baumeister and Hamilton’s (2019) model of the global oil market," Economics Letters, Elsevier, vol. 248(C).
    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. Karlsson, Sune, 2013. "Forecasting with Bayesian Vector Autoregression," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 2, chapter 0, pages 791-897, Elsevier.
    2. Silvia Miranda-Agrippino & Giovanni Ricco, 2018. "Bayesian vector autoregressions," Documents de Travail de l'OFCE 2018-18, Observatoire Francais des Conjonctures Economiques (OFCE).
    3. repec:spo:wpmain:info:hdl:2441/27od5pb99881folvtfs8s3k16l is not listed on IDEAS
    4. Dimitrios P. Louzis, 2017. "Macroeconomic and credit forecasts during the Greek crisis using Bayesian VARs," Empirical Economics, Springer, vol. 53(2), pages 569-598, September.
    5. Koop, Gary & Korobilis, Dimitris & Pettenuzzo, Davide, 2019. "Bayesian compressed vector autoregressions," Journal of Econometrics, Elsevier, vol. 210(1), pages 135-154.
    6. Gary Koop, 2012. "Using VARs and TVP-VARs with Many Macroeconomic Variables," Central European Journal of Economic Modelling and Econometrics, Central European Journal of Economic Modelling and Econometrics, vol. 4(3), pages 143-167, September.
    7. Andrea Carriero & Todd E. Clark & Massimiliano Marcellino, 2016. "Large Vector Autoregressions with Stochastic Volatility and Flexible Priors," Working Papers (Old Series) 1617, Federal Reserve Bank of Cleveland.
    8. Carriero, Andrea & Clark, Todd E. & Marcellino, Massimiliano, 2019. "Large Bayesian vector autoregressions with stochastic volatility and non-conjugate priors," Journal of Econometrics, Elsevier, vol. 212(1), pages 137-154.
    9. repec:rim:rimwps:18-30 is not listed on IDEAS
    10. Tomasz Wozniak, 2016. "Rare Events and Risk Perception: Evidence from Fukushima Accident," Department of Economics - Working Papers Series 2021, The University of Melbourne.
    11. 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.
    12. Korobilis, Dimitris & Pettenuzzo, Davide, 2019. "Adaptive hierarchical priors for high-dimensional vector autoregressions," Journal of Econometrics, Elsevier, vol. 212(1), pages 241-271.
    13. Follett, Lendie & Yu, Cindy, 2019. "Achieving parsimony in Bayesian vector autoregressions with the horseshoe prior," Econometrics and Statistics, Elsevier, vol. 11(C), pages 130-144.
    14. Dieppe, Alistair & van Roye, Björn & Legrand, Romain, 2016. "The BEAR toolbox," Working Paper Series 1934, European Central Bank.
    15. Tomasz Woźniak, 2016. "Bayesian Vector Autoregressions," Australian Economic Review, The University of Melbourne, Melbourne Institute of Applied Economic and Social Research, vol. 49(3), pages 365-380, September.
    16. Huber, Florian, 2016. "Density forecasting using Bayesian global vector autoregressions with stochastic volatility," International Journal of Forecasting, Elsevier, vol. 32(3), pages 818-837.
    17. Petrevski, Goran & Exterkate, Peter & Tevdovski, Dragan & Bogoev, Jane, 2015. "The transmission of foreign shocks to South Eastern European economies: A Bayesian VAR approach," Economic Systems, Elsevier, vol. 39(4), pages 632-643.
    18. Inske Pirschel & Maik H. Wolters, 2018. "Forecasting with large datasets: compressing information before, during or after the estimation?," Empirical Economics, Springer, vol. 55(2), pages 573-596, September.
    19. Korobilis, Dimitris, 2016. "Prior selection for panel vector autoregressions," Computational Statistics & Data Analysis, Elsevier, vol. 101(C), pages 110-120.
    20. Matkovskyy, Roman, 2012. "Прогнозування розвитку економіки України на основі баєсівських авторегресійних (BVAR) моделей з різними priors [Forecasting Economic Development of Ukraine based on BVAR models with different priors]," MPRA Paper 44725, University Library of Munich, Germany, revised Nov 2012.
    21. Joshua C. C. Chan & Eric Eisenstat & Chenghan Hou & Gary Koop, 2020. "Composite likelihood methods for large Bayesian VARs with stochastic volatility," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 35(6), pages 692-711, September.
    22. 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

    Keywords

    ;
    ;
    ;
    ;

    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:spr:compst:v:41:y:2026:i:2:d:10.1007_s00180-026-01716-8. 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: Sonal Shukla or Springer Nature Abstracting and Indexing (email available below). General contact details of provider: http://www.springer.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.