Skip to content

VAR estimation and identification for macroeconomics using R and C++

Notifications You must be signed in to change notification settings

GoldenBaozi/VARS

Repository files navigation

VARS

The goal of VARS is to implement various VAR estimation and identification approaches, as well as inference tools.

Progress

  • basic VAR model and VAR tools (IRF, FEVD, HDC)
  • classic VAR, i.e. OLS estimation, IV and recursive identification, bootstrap
  • bayesian VAR with (narrative) sign restrictions
  • add test data and code to the R package
  • add function and data documentation

Installation

You can install the development version of VARS from GitHub with:

# install.packages("pak")
pak::pak("GoldenBaozi/VARS")

Example

This is a basic example which estimates a simple VAR and identify using Cholesky decomposition, using Stock and Watson (2001) data

library(VARS)
# load data
data(SW2001)
# initialize var model
var1 <- cVAR$new(data = SW2001, p.lag = 4)
# OLS estimation
var1$est()
# recursive identification with block bootstrap
var1$identify(method = "recursive", boot.method = "block")
# compute IRF
IRF.1 <- var1$tool("IRF", 20, 0.90)
# plot preparation
shock.names <- var.names <- c("unemp", "infl", "ffr")
IRFs <- list(IRF.1)
# plot IRF
IRF.plot(var1, IRFs, 20, shock.names, var.names)

Replic

Replication of Antolín-Díaz and Rubio-Ramírez (2018), figure 2

IRFs of global oil market

IRFs of global oil market

For more results, see ./tests/testthat/

About

VAR estimation and identification for macroeconomics using R and C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published