我正在尝试使用软件包“ parallel”中的并行处理能力 我可以使用lapply获得必要的结果,但是使用parLapply会出错
错误:checkForRemoteErrors(val)中的错误: 2个节点产生错误;第一个错误:找不到函数“预测” 请你帮助我好吗? 预先感谢!
require(parallel)
require(forecast)
#Creation of the example list with 2 vectors
x1<-ts(1:21,start=c(2015,1),frequency = 12)
x2<-ts(2:20,start=c(2015,1),frequency = 12)
fARIMA <- function(x, h) {
forecast(auto.arima(x), h=h)
}
data<-list(x1,x2)
#Creation of the Cores for the parallel processing
no_cores<-detectCores()
clust<-makeCluster(no_cores)
CVlist1<-lapply(data,tsCV,forecastfunction=fARIMA,h=1) #function good
print(CVlist1)
CVlist2<-parLapply(clust,data,fARIMA,h=1) #Gives error
print(CVlist2)