impulseResponsePlot: Calculation and pretty plot of impulse response function

Description Usage Arguments Value Examples

View source: R/ts.R

Description

Computes and plots the impulse response function in black/white manner for suitability with common journals.

Usage

1
2
impulseResponsePlot(var, impulse, response, n.ahead = 10, filename = NULL,
  width = 10, height = 6, ...)

Arguments

var

Object package with impulse response function, i.e. type varest or svarest from the vars.

impulse

String identifier which variable experiences a shock.

response

String identfier which variable is the response.

n.ahead

Optional parameter to later choose a smaller x-range for the impulse response function. Argument expects a numeric value with the maximum step. Default is 10.

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 plotIrf

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: 
impulseResponsePlot(var.2c, impulse = "e", response = "prod", ylab = "Production")
impulseResponsePlot(var.2c, impulse = "e", response = "prod", ylab = "Production",
                    n.ahead = 5, filename = "irf_e_prod.pdf")

## End(Not run)

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