Learn R Programming

VARsignR (version 0.1.3)

fevdplot: Plotting variance decompositions with error bands from VAR posterior draws

Description

Generates plots of forecast error variance decompositions (FEVDs) with error bands from VAR posterior draws

Usage

fevdplot(fevddraws=NULL, type="median", labels=unlist(dimnames(fevddraws)[3]), save=FALSE, bands=c(0.16, 0.84), grid=TRUE, bw=FALSE, table=FALSE, periods=NULL)

Arguments

fevddraws
A $draws x steps x nvar$ array of posterior variance decompositions.
type
A string, either "median" or "mean" response, specifying the type of response to be plotted. The default is "median".
labels
A list of variable labels for FEVD plots, The default are the variable names of the model.
save
A logical statement to save the graph in the current working directory. The default is 'FALSE'.
bands
A list of length 2 containing the error bands of the decompositions. If bands='NULL', only FEVDs are plotted. The default is c(0.16, 0.84).
grid
A logical statement on whether or not to generate grid lines in the plots. The default is 'TRUE'.
bw
A logical statement on whether or not to generate black and white or colour graphs. The default is 'FALSE'.
table
A logical statement on whether or not a table should be returned instead of a graph. The default is 'FALSE'.
periods
A list of length smaller or equal the number of response steps. If periods='NULL', all periods are shown in the table. The default is 'NULL'.

Value

The function returns a plot or table of the FEVDs with user-selected percentiles.

Details

This function generates plots of forecast error variance decompositions (FEVDs) with error bands from VAR posterior draws produced by a Bayesian VAR model.

See Also

fp.target, irfplot.

Examples

Run this code
## Not run: 
# # Replication of Figure 5 of Uhlig (2005)
# 
# set.seed(12345)
# data(uhligdata)
# 
# # variable labels for plots
# vl <- c("GDP","GDP Deflator","Comm.Pr.Index","Fed Funds Rate",
#         "NB Reserves", "Total Reserves")
# 
# # estimates the model
# model0 <- rfbvar(Y=uhligdata, nlags=12, draws=1000, constant=FALSE,
#                   steps=60, shock=4)
# 
# # get posterior draws
# fevd0 <- model0$FEVDS
# 
# # plot impulse response functions
# fevdplot(fevddraws=fevd0, type="median", labels=vl, save=FALSE, bands=c(0.16, 0.84),
#         grid=TRUE, bw=FALSE)
# 
# ## End(Not run)
 

Run the code above in your browser using DataLab