MATLAB code for my research: three toolkits on GitHub, the code for each paper, and the code for my books.

Toolkits on GitHub

bvar-toolkit collects eleven of the packages below and factors the machinery they share — the samplers, the shrinkage priors, the marginal likelihood estimators — into a documented library, with fourteen examples to learn the methods.

statespace-toolkit collects fourteen other packages and factors the precision sampler, the integrated likelihood and the truncated normal sampler into a documented library, with ten examples to learn the methods.

trend-cycle-toolkit re-estimates six of the trend inflation and output gap models below every quarter and publishes the resulting estimates.

To learn the methods: the tutorials answer empirical questions with the settings of published papers, and the how-to guides show how to turn a model's equations into working MATLAB code, step by step.

Code for Each Paper

By topic: VARs and VARMAs · stochastic volatility and GARCH · marginal likelihood and DIC · inflation · output gap · other models. The research page lists the code with each paper, and the overviews of large Bayesian VARs, high-dimensional state space models and trend inflation models describe the main papers.

Vector Autoregressions and VARMAs

The research page on large Bayesian VARs describes the recent papers.

Stochastic Volatility and GARCH Models

Marginal Likelihood and Deviance Information Criterion

Models for Inflation

The research page on trend inflation models describes these models.

Models for Output Gap

Other Models

Code for My Books

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.

How to Cite

Each package page names the paper to cite, and the CITING.md files of bvar-toolkit and statespace-toolkit map each method to its paper. Please contact me if you find any errors.

Other Sources

Other econometricians, and the European Central Bank, provide MATLAB and R code for related models: