ar2ma: ar2ma

View source: R/ar2ma.R

ar2maR Documentation

ar2ma

Description

Convert AR coefficients to MA coefficients

Usage

ar2ma(ar, p, n = 11, CharValue = T)

Arguments

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

Details

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.

Value

a matrix which is MA coefficients

Examples

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)

common2016/MyFun documentation built on Sept. 23, 2024, 3:49 p.m.