MATLAB and R code for Statistical Modeling and Computation (Second Edition, 2025) is at the book website, and MATLAB code for Bayesian Econometric Methods (Second Edition) is at its book website. Code for Bayesian Macroeconometrics: Methods and Applications (Chapman & Hall/CRC, forthcoming) is on GitHub, in MATLAB, R and Python for all fourteen chapters.

Twelve of the packages below are also collected on GitHub as bvar-toolkit. Each is archived there exactly as it is distributed here, and the machinery they share — the samplers, the shrinkage priors, the marginal likelihood estimators — is factored into a single documented library. Download a zip below to reproduce a particular paper; use the toolkit to build on the code.

Start here

If you use code from this page, please cite the most relevant default reference(s) below. These papers form a coherent toolkit for scalable Bayesian time series and state space methods.

Research overviews: Large Bayesian VARs | High-dimensional state space models | Trend inflation models.

If you want to download the code associated with a particular paper, it will be easier to locate it at my research page. Below I organize the code by topics.

Please contact me if you find any errors.

Vector Autoregressions and VARMAs

See here for more information about my recent projects on large Bayesian VARs.

Stochastic Volatility and GARCH Models

Marginal Likelihood and Deviance Information Criterion

Models for Inflation

See here for more information about my research on trend inflation models.

Models for Output Gap

Other Models

Other Sources

A number of econometricians have provided code associated with their books or papers: