Description Usage Arguments Examples
View source: R/autoplot.varirf.R
plot all impulse response functions with their impulses and responses beautifully with ggplot2. Additionally you can save them directly by specifying a path.
1 2 |
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 |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.