资源说明:variance.model = list(model = "sGARCH", garchOrder = c(1, 1),submodel = NULL, external.regressors = NULL, variance.targeting = FALSE)
distribution.model = "norm"
ugarchfit(spec, datax, out.sample = 0, solver = "solnp", solver.control = list(),fit.control = list(stationarity = 1, fixed.se = 0, scale = 0))
myspec=ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1), submodel = NULL, external.regressors = NULL, variance.targeting = FALSE), mean.model = list(armaOrder = c(1, 1), include.mean = TRUE, archm = FALSE, archpow = 1, arfima = FALSE, external.regressors = NULL, archex = FALSE), distribution.model = "norm")
myfit=ugarchfit(myspec,data=datax,solver="solnp")
#rugarch包中模型结果的提取要依靠as.data.frame函数。比如提取模型的拟合值
as.data.frame(myfit,which="fitted")
#提取残差序列:
as.data.frame(myfit,which=" residuals")
#提取方差序列:
as.data.frame(myfit,which="sigma")
#当然,也可以同时查看所有:
as.data.frame(myfit,which=all)
#通过plot(myfit)可以对模型结果进行图形诊断:
plot(myfit)
#如果模型通过检验,可以用ugarchforcast函数对未来进行预测:
for<-ugarchforcast(myfit,n.ahead=20)
library(zoo) #时间格式预处理
library(xts) #同上
library(timeSeires) #同上
library(urca) #进行单位根检验
library(tseries) #arma模型
library(fUnitRoots) #进行单位根检验
library(FinTS) #调用其中的自回归检验函数
library(fGarch) #GARCH模型
library(nlme) #调用其中的gls函数
library(fArma) #进行拟合和检验
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。