Bayesian Macroeconometrics in R

GCEM Build BMR Build

Watch Star Fork

BMR (Bayesian Macroeconometrics in R) is an R interface to BM++, a templated C++ library for estimating Bayesian Vector Autoregression (BVAR) and Dynamic Stochastic General Equilibrium (DSGE) models.


  • Several popular prior specifications:
    • normal-inverse-Wishart prior,
    • Minnesota prior, and
    • Mattias Villani's steady-state prior.
  • BMR can estimate BVARs with time-varying parameters, as well as classical (non-Bayesian) VARs.
  • For DSGE models, the library can
    • solve models using Harald Uhlig's method of undetermined coefficients and Chris Sims' canonical decomposition;
    • estimate models using MCMC with a choice of filtering methods: the Kalman filter or Chandrasekhar recursions; and
    • estimate a hybrid DSGE-VAR model.
The R interface:
  • Provides seamless and efficient OO-based interaction using Rcpp modules.
  • Requires no knowledge of C++ by the user.

Author: Keith O'Hara


Download and Installation

Package requirements: R (v3.40, or above) and Rcpp, RcppArmadillo, ggplot2, and grid (this comes pre-packaged with R).

  • Execute the following commands, post installation of R itself, and you should be good to go:


The source code is available on GitHub. You need to install BMR from source.

  • Perhaps the quickest way to install from source is via the 'devtools' package in R.
  • First, make sure you have an appropriate development environment;
    • if you're using a Mac, get Xcode from the App Store and then check here;
    • if you're using Windows, get Rtools.
  • Then simply run the following commands in R:
  • install.packages("devtools")

After installing BMR, the user can check if everything is working as intended by typing:


This should load BMR and place a dataframe called 'USMacroData' into the workspace.

Replication Files

Replication files can be found in the tests folder.