Learn R Programming

tsDyn (version 0.9-1)

irf: Impulse response function

Description

Use the fevd function from package vars to tompute the impulse response coefficients of a VAR(p) (or transformed VECM to VAR(p)) for n.ahead steps.

Usage

## S3 method for class 'nlVar':
irf(x, impulse = NULL, response = NULL, n.ahead = 10,
ortho = TRUE, cumulative = FALSE, boot = TRUE, ci = 0.95,
runs = 100, seed = NULL, ...)

Arguments

x
Object of class VAR; generated by lineVar(), or object of class VECM; generated byVECM().
impulse
A character vector of the impulses, default is all variables.
response
A character vector of the responses, default is all variables.
n.ahead
Integer specifying the steps.
ortho
Logical, if TRUE (the default) the orthogonalised impulse response coefficients are computed (only for objects of class varest).
cumulative
Logical, if TRUE the cumulated impulse response coefficients are computed. The default value is false.
boot
Logical, if TRUE (the default) bootstrapped error bands for the imuplse response coefficients are computed.
ci
Numeric, the confidence interval for the bootstrapped errors bands.
runs
An integer, specifying the runs for the bootstrap.
seed
An integer, specifying the seed for the rng of the bootstrap.
...
Currently not used.

Value

  • A list of class varirf with the following elements is returned:
  • irfA list with matrices for each of the impulse variables containing the impulse response coefficients.
  • LowerIf boot = TRUE, a list with matrices for each of the impulse variables containing the lower bands.
  • UpperIf boot = TRUE, a list with matrices for each of the impulse variables containing the upper bands.
  • responseCharacter vector holding the names of the response variables.
  • impulseCharacter vector holding the names of the impulse variables.
  • orthoLogical, if TRUE, orthogonalised impulse reponses have been computed.
  • cumulativeLogical, if TRUE, cumulated impulse reponses have been computed.
  • runsAn integer, specifying the number of bootstrap runs.
  • ciNumeric, defining the confidence level.
  • bootLogical, if TRUE bootstrapped error bands have been computed.
  • modelCharacter, containing class(x).

encoding

latin1

concept

  • VAR
  • Vector autoregressive model
  • irf
  • impulse response function
  • VECM

Details

The function converts the VAR or VECM computed by package tsDyn into an object of class vec2var, on which then the irf method is applied. For details, see the relevant package.

References

Efron, B. and R. J. Tibshirani (1993), An Introduction to the Bootstrap, Chapman & Hall, New York. Hamilton, J. (1994), Time Series Analysis, Princeton University Press, Princeton.

Lütkepohl, H. (2006), New Introduction to Multiple Time Series Analysis, Springer, New York.

See Also

plot for the plot method. lineVar, VECM for the models.

Examples

Run this code
data(barry)

## For VAR
mod_var <- lineVar(barry, lag = 2)
irf(mod_var, impulse = "dolcan", response = c("dolcan", "cpiUSA", "cpiCAN"), boot =
FALSE)

## For VECM
mod_VECM <- VECM(barry, lag = 2, estim="ML", r=2)
irf(mod_VECM, impulse = "dolcan", response = c("dolcan", "cpiUSA", "cpiCAN"), boot =
FALSE)

Run the code above in your browser using DataLab