如何从varest对象中提取残差的相关矩阵?

How to extract the correlation matrix of residuals from a varest object?

我估计了一个 var 模型,问题是是否可以只提取残差的相关矩阵?

Var1 <- VAR(vardata1,p = 1,type = "const") #estimation of the var model 
summary(Var1) #showing summary --> correlation matrix is part of it. 

你可以通过使用 summary() 函数的一点额外步骤来获得残差的相关矩阵。

summary(Var1)$corres

#             var1        var2
# var1  1.00000000 -0.01372398
# var2 -0.01372398  1.00000000