解决方案: 运行ugarchroll,报错Error in try(.C("c_qstd", p = as.double(p), mu = as.double(mu), sigma = as.double(sigma), : NA/NaN/Inf in foreign function call (arg 3)

cl = makePSOCKcluster(10)


roll = ugarchroll(myspec, rlogdiff, n.start = 200,refit.every = 20,
refit.window = "moving", solver = "hybrid",
calculate.VaR = TRUE, VaR.alpha = c(0.01, 0.025, 0.05),
cluster = cl, keep.coef = TRUE, stringsAsFactors = T)

加入红色的那个参数就可以了,没有这个参数就会报 Error in try(.C("c_qstd", p = as.double(p), mu = as.double(mu), sigma = as.double(sigma),  :  NA/NaN/Inf in foreign function call (arg 3)

可参考的资料:

https://discuss.analyticsvidhya.com/t/error-in-randomforest-default-m-y-na-nan-inf-in-foreign-function-call-arg-1-in-r/1264/3

 

原文地址:https://www.cnblogs.com/thinkers-dym/p/6860515.html