Learn R Programming

BVAR (version 0.1.5)

plot.bvar_irf: Impulse response plot

Description

Plotting method for impulse responses obtained from bvar. Impulse responses of all or a subset of the available variables can be plotted.

Usage

# S3 method for bvar_irf
plot(x, conf_bands = 0.16, variables = NULL,
  vars_impulse = NULL, vars_response = NULL, mar = c(2, 2, 2, 0.5),
  ...)

bv_plot_irf(x, conf_bands = 0.16, variables = NULL, vars_impulse = NULL, vars_response = NULL, mar = c(2, 2, 2, 0.5), ...)

Arguments

x

A bvar / bvar_irf object, obtained from bvar.

conf_bands

Numeric vector of desired confidence bands. E.g. for bands at 5%, 10%, 90% and 95% set this to c(0.05, 0.1).

variables

Optional character vector. Names of all variables in the object. Taken from x$variables if available.

vars_impulse

Optional numeric or character vector. Used to subset the plot's impulses to certain variables by position or name (variables must be available). Defaults to NULL, i.e. all variables.

vars_response

Optional numeric or character vector. Used to subset the plot's responses to certain variables by position or name (variables must be available). Defaults to NULL, i.e. all variables.

mar

Numeric vector. Margins for par.

...

Other graphical parameters for par.

Examples

Run this code
# NOT RUN {
data <- matrix(rnorm(400), ncol = 4)
x <- bvar(data, lags = 2)

# Plot impulse responses for all available variables
bv_plot_irf(x)

# Subset to impulse variables in positions 2 and 4 via position and name
bv_plot_irf(x, vars_impulse = c(2, 4))

# Use the method to plot and adjust confidence bands
plot(x$irf, conf_bands = c(0.01, 0.05))
# }

Run the code above in your browser using DataLab