Update: this material has been substantially expanded into the book Bayesian Macroeconometrics: Methods and Applications (Chapman & Hall/CRC, forthcoming). A sample containing the preface and the first four chapters is available here, and MATLAB, R and Python code for all 14 chapters is available on GitHub.
Tutorials and code libraries: the tutorials answer questions from applied work on Bayesian VARs and state space models with the settings of published papers, and each comes with MATLAB code that runs on your own data:
- Does the Order of the Variables Change My VAR Results?
- How Should I Choose the Shrinkage Hyperparameters of My BVAR?
- Which Stochastic Volatility Specification Should My VAR Use?
- Does Modeling the Volatility Improve My Forecasts?
- Can I Use Many Sign Restrictions in My Large VAR?
- How Do I Handle Missing and Mixed-Frequency Data in My VAR?
- Which Unobserved Components Model Should I Use for Inflation?
- Which Parameters of a GDP Nowcasting Model Should Vary over Time?
The tutorials run on two MATLAB libraries: bvar-toolkit, for large Bayesian VARs with shrinkage priors, stochastic volatility, marginal likelihoods and forecasting, and statespace-toolkit, for unobserved components, time-varying parameter, stochastic volatility and dynamic factor models. A third, trend-cycle-toolkit, updates estimates of US trend inflation and the output gap every quarter.
How-to guides: the guides show how to turn a model's equations into working MATLAB code, step by step, on small examples with generated data, and name the sections of the book behind each method:
- How to Draw the States of an Unobserved Components Model
- How to Estimate a State Space Model by Gibbs Sampling
- How to Compute the Integrated Likelihood of a State Space Model
- How to Stack the Equations of a VAR
- How to Draw the VAR Coefficients under the Minnesota Prior
- How to Estimate a VAR by Gibbs Sampling
- How to Choose the Shrinkage of a VAR by the Marginal Likelihood
Below you will find the course notes on Bayesian Macroeconometrics for a PhD course I recently taught. I intend to add additional materials when time permits. Please let me know if you find any typos or if something doesn't make sense.
Current version: ver 1.4 (2017-06)
The associated datasets and code can be downloaded here
- ver 1.4 (2017-06): added the chapter Mixture Models
- ver 1.3 (2017-03): added the chapter Bayesian Model Comparison
- ver 1.2 (2017-02): added the chapter Overview of Bayesian Econometrics
- ver 1.1 (2017-01): updated references and corrected a few typos
- ver 1.0 (2016-11): initial version