使用rugarch在R中获取GARCH的RMSE

时间:2016-04-17 11:58:57

标签: r

我在R中编写了一段代码来计算和显示时间序列的标准图,看起来像这样。 DWDMData.csv的内容如下

Time,IndexValue,Volatility
1,101.22,0.00526633297276868
2,102.18,0.00409956537347567
3,102.44,0.00110367145014756

这个代码是

library(rugarch)
dataset <- read.csv("DWDMData.csv",TRUE)
memdata = dataset[,c("Volatility")] 
memtrain = head(memdata, 450) 
memtest = dataset[451:500,c("Volatility")]

diff.memtrain = diff(memtrain)


arch.spec.std = ugarchspec(variance.model=list(garchOrder=c(0,1)),mean.model= list(armaOrder=c(0,2)),distribution.model = "std")
arch.fit.std = ugarchfit(spec=arch.spec.std, data=diff.memtrain,solver.control=list(trace = 1))
plot(arch.fit.std)

然而,我希望接下来的50个预测来比较RMSE误差以及用于训练的数据集中的残差。我该怎么做?

0 个答案:

没有答案