Skip to contents

Same quantity as irfun: the orthogonalised impulse response of a VAR(p), the MA recursion Phi_0 = I, Phi_h = sum_{j=1..min(h,p)} A_j Phi_{h-j}, with shocks orthogonalised by the lower Cholesky factor P of Sigma_u, so Theta_h = Phi_h P. Despite the name this is not "variable importance"; it is the VAR impulse response.

Usage

Varimp(coef, sigma_u, horizon = 20, shock_var = 0)

Arguments

coef

m by (1 + m p) coefficient matrix from Varest.

sigma_u

m by m residual covariance.

horizon

Periods ahead.

shock_var

0-based index of the shocked variable.

Value

As Irfun.

References

Lutkepohl, H. (2005). New Introduction to Multiple Time Series Analysis. Springer, Ch. 2.3. doi:10.1007/978-3-540-27752-1.

Examples

Varimp(matrix(c(0, 0.5, 0.1, 0, 0.2, 0.4), 2, 3), diag(2), 3)$irf
#>       [,1] [,2]
#> [1,] 1.000    0
#> [2,] 0.100    0
#> [3,] 0.010    0
#> [4,] 0.001    0