ar2ma | R Documentation |
Convert AR coefficients to MA coefficients
ar2ma(ar, p, n = 11, CharValue = T)
ar |
AR coefficients matrix which is k x kp dimenstion, k is numbers of variables, and no constant. |
p |
lags orders of AR |
n |
lags orders of MA generated |
CharValue |
logitcal value, wheater compute character value |
the formula is,
A_s = F_1 * A_{s-1} + F_2 * A_{s-2} + ... + F_p * A_{s-p}
where A is MA coeffiencts, F is AR coeffiencts.
a matrix which is MA coefficients
data(Canada, package = 'vars')
ar <- vars::Bcoef(vars::VAR(Canada, p = 2, type = "none"))
ar
ma <- ar2ma(ar, p = 2)
# GIRF
fit <- vars::VAR(Canada, p = 2, type = "none")
sig_u <- t(residuals(fit)) %*% residuals(fit)
GI(ma, sig_u, imp_var = 1)
# 预测第二个变量时,第一个变量所占比重
GFEVD(ma, sig_u, imp_var = 1, res_var = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.