autoplot: autoplot

Description Usage Arguments Examples

View source: R/autoplot.varirf.R

Description

plot all impulse response functions with their impulses and responses beautifully with ggplot2. Additionally you can save them directly by specifying a path.

Usage

1
2
## S3 method for class 'varirf'
autoplot(irf, path = getwd(), file_name, device = "pdf", res = 900)

Arguments

irf

varirf object, which is to be plotted.

path

character, specifying the path where the plots are safed.

file_name

character, specifying the prefix of the final plot names.

device,

character, specifying the output type, default is "pdf"

res,

integer, specifying the resolution of the output files

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library("FredApi")
library("vars")
library("beautyIRF")

x1 <- get_symbols("AURUKM")
x2 <- get_symbols("LRHUTTTTITM156S")
x3 <- get_symbols("LRHUTTTTFRM156S")

x1 <- x1["2000-01-01::2016-01-01"]
x2 <- x2["2000-01-01::2016-01-01"]
x3 <- x3["2000-01-01::2016-01-01"]

x <- data.frame(x1, x2, x3)

VAR1 <- VAR(x, lag.max = 12, type = "cons")

irf <- vars::irf(VAR1, n.ahead = 20)

autoplot(irf)

markushhh/beautyIRF documentation built on Feb. 14, 2020, 9:21 a.m.