- pred = Forecast$new( dates=sapply( indices, integerIndexToDate, data ) )
- forecaster_class_name = getFromNamespace(paste(forecaster,"Forecaster",sep=""), "talweg")
- forecaster = forecaster_class_name$new(data=data,
- pjump = getFromNamespace(paste("get",pjump,"JumpPredict",sep=""), "talweg"))
- for (today in integer_indices)
+ pred = Forecast$new( sapply(indices, function(i) integerIndexToDate(i,data)) )
+ forecaster_class_name = getFromNamespace(
+ paste(forecaster,"Forecaster",sep=""), "talweg")
+
+ if (!is.null(pjump))
+ pjump <- getFromNamespace(paste("get",pjump,"JumpPredict",sep=""), "talweg")
+ forecaster = forecaster_class_name$new(pjump)
+
+ computeOneForecast <- function(i)
+ {
+ list(
+ "forecast" = forecaster$predictSerie(data,i,memory,predict_from,horizon,...),
+ "params" = forecaster$getParameters(),
+ "index" = i )
+ }
+
+ p <-
+ if (ncores > 1 && requireNamespace("parallel",quietly=TRUE))
+ parallel::mclapply(integer_indices, computeOneForecast, mc.cores=ncores)
+ else
+ lapply(integer_indices, computeOneForecast)
+
+ # TODO: find a way to fill pred in //...
+ for (i in seq_along(integer_indices))