irfplot: Plotting impulse responses with error bands from VAR...

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/irfplot.R

Description

Generates plots of impulse responses with error bands from VAR posterior draws

Usage

1
2
irfplot(irfdraws=NULL,type="median", labels=unlist(dimnames(irfdraws)[3]),
        save=FALSE, bands=c(0.16, 0.84), grid=TRUE, bw=FALSE)

Arguments

irfdraws

A draws x steps x nvar array of posterior impulse responses.

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 impulse response 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 impulse responses. If bands='NULL', only IRFs 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'.

Details

This function generates plots of impulse responses with error bands from VAR posterior draws produced by a Bayesian VAR model.

Value

The function returns a plot of the IRFs with user-selected percentiles.

Note

Users should consult the reference papers and the package vignette for more information.

Author(s)

Christian Danne

See Also

fp.target, fevdplot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## 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
irfs0 <- model0$IRFS

# plot impulse response functions
irfplot(irfdraws=irfs0, type="mean", labels=vl, save=FALSE, bands=c(0.16, 0.84),
        grid=TRUE, bw=FALSE)


## End(Not run)
 

VARsignR documentation built on May 2, 2019, 5:20 a.m.