﻿Replication Codes for "How to Estimate a VAR after March 2020," by
Michele Lenza and Giorgio Primiceri.

This folder contains the following files:

• Main replication code

  ◦ RunAllModels_GenerateFigures.m: run this code to replicate the
  results in the paper. It estimates all the models used in the paper
  and produces all the figures in the paper. It calls the following
  codes

    ▪ Baseline_May2021.m: estimates a VAR with COVID volatility on
    data up to May 2021; produces forecasts starting in June 2021

    ▪ CVFeb2020_May2021.m: estimates a VAR with CONSTANT volatility on
    data up to February 2020; produces forecasts starting in June 2021

    ▪ CV_May2021.m: estimates a VAR with CONSTANT volatility on data
    up to May 2021; produces forecasts starting in June 2021

    ▪ Baseline_June2020.m: estimates a VAR with COVID volatility on
    data up to June 2020; produces forecasts starting in July 2020

    ▪ CVFeb2020_June2020.m: estimates a VAR with CONSTANT volatility
    on data up to February 2020; produces forecasts starting in July
    2020

    ▪ GenerateFigures.m: loads the estimation resulst obtained and
    stored using the previous codes, and produces all the figures of
    the paper 

• Data

  ◦ dataMLprojectMay2021.xlsx: contains the time-series data used to
  estimate the model, and their description. These data have been
  downloaded from FRED and are publicly available

• Main function

  ◦ bvarGLP_covid.m: estimates the BVAR with a change in volatility
  starting on the “Tcovid” observation

• Auxiliary Fuctions

  ◦ logMLVAR_formin_covid.m: computes the marginal likelihood and the
  posterior mode of the parameters and hyperparameters

  ◦ logMLVAR_formcmc_covid.m: computes the marginal likelihood and
  draws from the posterior of the parameters 

  ◦ setpriors_covid.m: sets up the default choices for the prior

• Subroutines are collected in two sub-directories, which also
includes the optimization functions “csminwel.m” by Chris Sims
(http://www.princeton.edu/~sims/)

• In a separate folder, we also include the replication codes of our
earlier paper, “Prior Selection for Vector Autoregressions,” by
Giannone, Lenza and Primiceri (2015, REStat).
