'update'
[talweg.git] / pkg / R / computeForecast.R
index c778d66..e1b29b6 100644 (file)
@@ -27,6 +27,7 @@
 #' @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
@@ -60,7 +61,7 @@
 #' } }
 #' @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]
@@ -89,6 +90,8 @@ computeForecast = function(data, indices, forecaster, pjump, predict_from,
 
        computeOneForecast <- function(i)
        {
+               if (verbose)
+                       print(paste("Index",i))
                list(
                        "forecast" = forecaster$predictSerie(data,i,memory,predict_from,horizon,...),
                        "params" = forecaster$getParameters(),