View source: R/varexternalinstrument.R
| externalinstrument | R Documentation |
Identify the impulse response for a VAR (using the VAR estimated from the vars package), using a high frequency instrument.
externalinstrument(var, instrument, dependent, p)
var |
A varest var, or a dataframe of reduced form residuals. |
instrument |
A list containing the data for the instrument. Should be same length as the estimation sample. |
dependent |
Which variable in your var are you instrumenting (as a string). |
p |
(Integer) How many lags does your var have (only needed if supplying a dataframe instead of a varest). |
library(vars)
library(varexternalinstrument)
data(GKdata)
gkvar <- VAR(GKdata[, c("logip", "logcpi", "gs1", "ebp")], p = 12, type = "const")
shockcol <- externalinstrument(gkvar, GKdata$ff4_tc, "gs1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.