| VECM | R Documentation |
Estimates a VECM under a given cointegration-rank restriction or cointegrating vectors.
VECM(
y,
dim_p,
x = NULL,
dim_q = dim_p,
dim_r = NULL,
beta = NULL,
type = c("Case1", "Case2", "Case3", "Case4", "Case5"),
t_D1 = list(),
t_D2 = list(),
D1 = NULL,
D2 = NULL
)
y |
Matrix. A |
dim_p |
Integer. Lag-order |
x |
Matrix. A |
dim_q |
Integer. Lag-order |
dim_r |
Integer. Cointegration-rank |
beta |
Matrix. A |
type |
Character. The conventional case of the deterministic term in the Johansen procedure. |
t_D1 |
List of vectors. The activating break periods |
t_D2 |
List of vectors. The activating break periods |
D1 |
Matrix. A |
D2 |
Matrix. A |
A list of class 'varx'.
Johansen, S. (1996): Likelihood-Based Inference in Cointegrated Vector Autoregressive Models, Advanced Texts in Econometrics, Oxford University Press, USA.
Luetkepohl, H. (2005): New Introduction to Multiple Time Series Analysis, Springer, 2nd ed.
### extend basic example in "vars" ###
library(vars)
data(Canada)
names_k = c("e", "U", "rw") # names of endogenous variables
names_l = c("prod") # names of exogenous variables
names_s = NULL # optional shock names
x = Canada[ , names_l, drop=FALSE]
y = Canada[ , names_k, drop=FALSE]
# colnames of the restriction matrices are passed as shock names #
SR = matrix(NA, nrow=4, ncol=4, dimnames=list(NULL, names_s))
SR[4, 2] = 0
LR = matrix(NA, nrow=4, ncol=4, dimnames=list(NULL, names_s))
LR[1, 2:4] = 0
LR[2:4, 4] = 0
# estimate, identify, and plot the IRF #
R.vecm = VECM(y=y, dim_p=3, x=x, dim_q=3, dim_r=1, type="Case4")
R.grt = id.grt(R.vecm, LR=LR, SR=SR)
R.irf = irf(R.grt, n.ahead=50)
plot(R.irf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.