晚上好!现在我用外部回归器测试了GARCH模型:
library("tseries")
library("xts")
library("rugarch")
Rim <- read.csv("Rim.csv", header=T, sep=";")
Rcm <- read.csv("Rcm.csv", header=T, sep=";")
n=119
spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1), submodel = NULL, external.regressors = NULL, variance.targeting = FALSE), mean.model = list(armaOrder = c(0, 0), external.regressors = matrix(Rcm[,1])), distribution.model = "norm", start.pars = list(), fixed.pars = list())
my_lms=lapply(1:n,function(x) ugarchfit(spec=spec,data=Rim[,x],solver.control=list(trace=0)))
昨天我测试了这个模型,R显示了这个模型的结果。今天我没有更改代码,但现在R给出了错误:
Warning messages:
1: In .sgarchfit(spec = spec, data = data, out.sample = out.sample, :
ugarchfit-->warning: solver failer to converge.
2: In .sgarchfit(spec = spec, data = data, out.sample = out.sample, :
ugarchfit-->warning: solver failer to converge.
此外,我在错误后更新了这个软件包。 我还会说明下一个信息:
sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251 LC_MONETARY=Russian_Russia.1251
[4] LC_NUMERIC=C LC_TIME=Russian_Russia.1251
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] rugarch_1.3-6 xts_0.9-7 zoo_1.8-0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.10 magrittr_1.5 knitr_1.15.1 misc3d_0.8-4
[5] xtable_1.8-2 lattice_0.20-35 R6_2.2.0 FNN_1.1
[9] Rsolnp_1.16 GeneralizedHyperbolic_0.8-1 SkewHyperbolic_0.3-2 tools_3.4.0
[13] spd_2.0-1 grid_3.4.0 KernSmooth_2.23-15 htmltools_0.3.6
[17] digest_0.6.12 rgl_0.98.1 numDeriv_2016.8-1 Matrix_1.2-9
[21] shiny_1.0.3 nloptr_1.0.4 DistributionUtils_0.5-1 ks_1.10.6
[25] htmlwidgets_0.8 codetools_0.2-15 mime_0.5 compiler_3.4.0
[29] multicool_0.1-10 expm_0.999-2 jsonlite_1.4 truncnorm_1.0-7
[33] mvtnorm_1.0-6 httpuv_1.3.3
请告诉我是什么问题,因为我无法理解这个错误。谢谢。
答案 0 :(得分:1)
如果您将求解器设置为hybrid
,它将成功解决。参见以下示例:
ugarchfit(data=file1[,3],spec=spec2,solver ='hybrid')