我正在拟合一个EGARCH模型,并想为金融危机添加一个虚拟变量。
我看了一下,这应该是很容易的,我可以把它作为外部回归因子。然而,从系数中可以看出,输出完全不对。
以下是我的虚拟变量设置
Minexts$d1<-0
Minexts$d1["2008-09/2009-03"]<-1
而这里先是规范,然后是模型的运行情况。
spec = ugarchspec(mean.model=list(armaOrder=c(1,1)),
variance.model=list(garchOrder=c(1,1), model="eGARCH",
external.regressors=matrix(Minexts$d1["/2015"])),
distribution.model = "std", fixed.pars =list(mu=0.0) )
fitEGARCH = ugarchfit(spec,data=Minexts$WMT["/2015"],solver="hybrid")
coef(fitEGARCH)
mu ar1 ma1 omega alpha1 beta1 gamma1 vxreg1
0.0000000 0.6552576 -0.7187839 -1.7571401 0.0396366 0.8837458 4.9959081 -24.0575585
shape
3.9946464
假人的系数与预期的符号不符 而且绝对值很大
这里是部分数据,虚拟变量从0到1,所以你可以看到你是否有同样的问题。
structure(c(0.6297141, 0.5914289, -0.5338551, -2.453003, -1.989819,
0.4622551, -3.498437, -0.6471709, -0.17670971, -0.17702253, 2.13855652,
-2.56469353, 1.51865889, 0.1401051, -3.0924803, 0.64771727, 0.2908709,
0.9686866, 1.205483, -1.081182, -0.6230996, -0.08598195, -3.056884,
0.3139459, 0.7656354, 0.4903214, 0.9901902, -1.361938, 0.9770967,
0.2344274, -0.0167266, 1.59313, 0, 0, 0, 0, 1, 1, 1, 1), class = c("xts",
"zoo"), index = structure(c(1219708800, 1219795200, 1219881600,
1219968000, 1220313600, 1220400000, 1220486400, 1220572800), tzone = "UTC", tclass = "Date"), .Dim = c(8L,
5L), .Dimnames = list(NULL, c("AAPL", "GE", "SPY", "WMT", "d1"
)))
这张图是西格玛的图。