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