knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of FAVAR is to estimate a FAVAR model by Bernanke et al. (2005).
You can install the package FAVAR from CRAN:
install.packages('FAVAR')
You can install the development version of FAVAR from GitHub with:
# install.packages("devtools") devtools::install_github("common2016/FAVAR")
This is a basic example which shows you how to estimate a FAVAR model:
library(FAVAR) ## basic example code data('regdata') fit <- FAVAR(Y = regdata[,c("Inflation","Unemployment","Fed_funds")], X = regdata[,1:115], slowcode = slowcode,fctmethod = 'BBE', factorprior = list(b0 = 0, vb0 = NULL, c0 = 0.01, d0 = 0.01), varprior = list(b0 = 0,vb0 = 10, nu0 = 0, s0 = 0), nrep = 500, nburn = 100, K = 2, plag = 2) # print FAVAR estimation results summary(fit,xvar = c(3,5)) # plot impulse response figure library(patchwork) ans <- irf(fit,resvar = c(2,9,10), tcode = tcode, nhor = 21, showplot = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.