Code & Software

Bayesian Poisson Vector Autoregression model code and examples.  This replication code fits the models in Brandt and Sandler (2012). It used R and JAGS.  See the documentation inside the replication materials for details.

MSBVAR R Package MS-BVAR = Markov-switching and Bayesian Vector Autoregression package for R. Provides methods for estimating frequentist, Bayesian Vector Autoregression (BVAR), Bayesian structural vector autoregression (B-SVAR) and reduced form Markov-switching Bayesian vector autoregression (MS-BVAR) models.  Includes methids for generating posterior inferences for these (MS)BVAR models and their forecasts, impulse responses (using likelihood-based error bands), and forecast error decompositions.  Also includes utility functions for plotting forecasts and impulse responses, and draws from Wishart and singular multivariate normal densities.  This package is available on CRAN, so try “install.packages(“MSBVAR”)” in R!

PEST: Poisson Estimators for State-Space Time Series R, version 1.1.6 (Update 2017-06-19) This is the R implementation fo the Gauss PESTS code. This code will allow you to estimate the models in Brandt et al. (2000) and Brandt and Williams (2001). This ia a major rewrite from the initial GAUSS version in the papers since it uses standard R formula specifications.  Also includes are functions for computing impact multipliers and responses for the PAR(p) model.  See the examples below for how to use this code.

PESTS - R version sample program. This program illustrates how to simulate PEWMA and PAR(p) data and estimate the models in R using the pests.R script that is linked above.

Additional example files for fitting different event time time series in R:

Gauss Code for the PESTS models (legacy code that has not been updated in 15+ years).  Use the R code version above is what I support and maintain now.

© Patrick Brandt 2017, the whole site!