{
# Parameters (potentially) computed during shape prediction stage
predicted_shape <- self$predictShape(data,today,memory,predict_from,horizon,...)
+
+ if (is.na(predicted_shape))
+ return (NA)
+
predicted_delta <-
if (is.null(private$.pjump))
NULL
indices = params$indices[filter]
weights = params$weights[filter]
+ if (is.na(indices[1]))
+ return (NA)
+
gaps = sapply(indices, function(i) {
if (predict_from >= 2)
data$getSerie(i)[predict_from] - data$getSerie(i)[predict_from-1]
#' @param memory Data depth (in days) to be used for prediction.
#' @param horizon Last time step to predict.
#' @param ncores Number of cores for parallel execution (1 to disable).
+#' @param verbose TRUE to print basic traces (runs beginnings)
#' @param ... Additional parameters for the forecasting models.
#'
#' @return An object of class Forecast
#' } }
#' @export
computeForecast = function(data, indices, forecaster, pjump, predict_from,
- memory=Inf, horizon=length(data$getSerie(1)), ncores=3, ...)
+ memory=Inf, horizon=length(data$getSerie(1)), ncores=3, verbose=FALSE, ...)
{
# (basic) Arguments sanity checks
predict_from = as.integer(predict_from)[1]
computeOneForecast <- function(i)
{
+ if (verbose)
+ print(paste("Index",i))
list(
"forecast" = forecaster$predictSerie(data,i,memory,predict_from,horizon,...),
"params" = forecaster$getParameters(),