我曾尝试在 R 中使用 garchFit 并发现一些非常奇怪的东西,似乎所有的拟合都是一样的。我尝试使用 R 页面中的示例并发现相同的结果。
如果您打开 R 并键入以下内容:
library(fGarch);
## UNIVARIATE TIME SERIES INPUT:
# In the univariate case the lhs formula has not to be specified ...
# A numeric Vector from default GARCH(1,1) - fix the seed:
N = 200
x.vec = as.vector(garchSim(garchSpec(rseed = 1985), n = N)[,1])
garchFit(~ garch(1,1), data = x.vec, trace = FALSE)
# An univariate timeSeries object with dummy dates:
x.timeSeries = dummyDailySeries(matrix(x.vec), units = "GARCH11")
gfit = garchFit(~ garch(1,1), data = x.timeSeries, trace = FALSE)
然后进行以下健全性检查似乎表明残差计算正确:
gfit@residuals == (x.vec - gfit@fitted)
但是,如果您检查 gfit@fitted 的内容,您会发现所有值都是相同的!所以基本上 garchFit 函数找到了一条水平线?
这个例子是预期的吗?