我在R中使用fGARCH包,以便将ARMA_GARCH(1,1)模型拟合到时间序列中。我想提取标准化残差,即残差除以相应的每日波动率估计值。我试着做一些事情
res <- residuals(m1, standardize=FALSE)
vol <- volatility(m1)
stand.res <- res/vol和
stand.res <- residuals(m1, standardize=TRUE)如果我绘制两个结果,它们就会彼此不同。为什么会这样呢?
非常感谢。
发布于 2016-02-23 15:19:38
我也有类似的问题,请考虑一下:
rm(list=ls(all=TRUE))
library(fGarch)
set.seed(4)
x <- runif(6587, -0.10, 0.10)
gfit <- garchFit(formula = ~ garch(2,2), cond.dist = "std", data = x, include.shape=TRUE, trace=FALSE)和
condVar = gfit@h.t
resid <- (x / sqrt(condVar));
tail(resid) # Standardized Residuals
#[1] -0.4201041 -0.8342208 1.5639541 1.0237848 -0.1779349 -0.7820030
#or
tail(x/ gfit@sigma.t)
#[1] -0.4201041 -0.8342208 1.5639541 1.0237848 -0.1779349 -0.7820030vs
tail(residuals(gfit, standardize = TRUE))
#[1] -0.4156200 -0.8297368 1.5684382 1.0282689 -0.1734509 -0.7775190https://stackoverflow.com/questions/34090073
复制相似问题