| irf.pvarx | R Documentation |
Calculates impulse response functions for panel VAR objects.
## S3 method for class 'pvarx'
irf(x, ..., n.ahead = 20, normf = NULL, w = NULL, MG_IRF = TRUE)
x |
Panel VAR object of class ' |
... |
Currently not used. |
n.ahead |
Integer. Number of periods to consider after the initial impulse, i.e. the horizon of the IRF. |
normf |
Function. A given function that normalizes the |
w |
Numeric, logical, or character vector.
|
MG_IRF |
Logical. If |
A list of class 'svarirf' holding the impulse response functions as a 'data.frame'.
Luetkepohl, H. (2005): New Introduction to Multiple Time Series Analysis, Springer, 2nd ed.
Gambacorta L., Hofmann B., and Peersman G. (2014): "The Effectiveness of Unconventional Monetary Policy at the Zero Lower Bound: A Cross-Country Analysis", Journal of Money, Credit and Banking, 46, pp. 615-642.
Jentsch, C., and Lunsford, K. G. (2021): "Asymptotically Valid Bootstrap Inference for Proxy SVARs", Journal of Business and Economic Statistics, 40, pp. 1876-1891.
data("PCAP")
names_k = c("g", "k", "l", "y") # variable names
names_i = levels(PCAP$id_i) # country names
L.data = sapply(names_i, FUN=function(i)
ts(PCAP[PCAP$id_i==i, names_k], start=1960, end=2019, frequency=1),
simplify=FALSE)
# estimate and identify panel SVAR #
L.vars = lapply(L.data, FUN=function(x) vars::VAR(x, p=2, type="both"))
R.pid = pid.chol(L.vars, order_k=names_k)
# calculate and plot MG-IRF #
library("ggplot2")
R.irf = irf(R.pid, n.ahead=60)
F.irf = plot(R.irf, selection=list(2:4, 1:2))
as.pplot(F.irf=F.irf, color_g="black", n.rows=3)$F.plot + guides(color="none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.