plotIrf: Pretty plot of impulse response function

Description Usage Arguments Value Examples

View source: R/ts.R

Description

Plots the impulse response function in black/white manner for suitability with common journals.

Usage

1
2
plotIrf(irf, name = NULL, ylab = NULL, alpha = 0.3, n.ahead = NULL,
  filename = NULL, width = 10, height = 6, ...)

Arguments

irf

Object package with impulse response function, i.e. type varirf from the vars

name

Name of variable of interest.

ylab

Text on y-axis. By default, this argument is NULL and the variable name is taken automatically instead.

alpha

Opacity for confidence interval. Default is 0.3

n.ahead

Optional parameter to later choose a smaller x-range for plotting. Argument expects a numeric value with the maximum step.

filename

Filename to export the table as LaTeX. Default is NULL, i.e. no export.

width

Width of exported figure (default: 10).

height

Height of exported figure (default: 6).

...

Further arguments passed on to ggsave

Value

Object of ggplot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(vars)
data(Canada)
# For VAR
var.2c <- VAR(Canada, p = 2, type = "const")
## Not run: 
irf <- irf(var.2c, impulse = "e", response = "prod", boot = TRUE)
plotIrf(irf, ylab = "Production")
plotIrf(irf, ylab = "Production", filename = "irf_e_prod.pdf")

## End(Not run)

sfeuerriegel/ResearchGroupTools documentation built on May 29, 2019, 8:01 p.m.