getStdHorizon = function()
24 - as.POSIXlt( private$.data[[1]]$time[1] )$hour + 1
,
- appendHat = function(time, exo_hat)
+ append = function(time, exo_hat)
private$.data[[length(private$.data)+1]] <- list("time"=time,"exo_hat"=exo_hat)
,
append = function(time, serie, exo)
#' data$initialize()
#' forecaster <- MyForecaster$new(myJumpPredictFunc)
#' repeat {
-#' # During the night between days j and j+1:
-#' data$appendExoHat(exogenous_predictions)
#' # In the morning 7am+ or afternoon 1pm+:
-#' data$setMeasures(
-#' data$getSize()-1,
+#' data$append(
#' times_from_H+1_yersteday_to_Hnow,
#' PM10_values_of_last_24h,
-#' exogenous_measures_for_yersteday)
+#' exogenous_measures_of_last_24h,
+#' exogenous_predictions_for_next_24h)
#' pred <- forecaster$predictSerie(data, data$getSize()-1, ...)
#' #do_something_with_pred
#' }}
}
}
- hat_exo = as.data.frame( exo_df[i,(1+nb_exos+1):(1+2*nb_exos)] )
exo = as.data.frame( exo_df[i,2:(1+nb_exos)] )
- data$appendHat(time, hat_exo)
- data$append(serie, exo) #in realtime, this call comes hours later
+ exo_hat = as.data.frame( exo_df[i,(1+nb_exos+1):(1+2*nb_exos)] )
+ data$append(time, serie, exo, exo_hat)
if (i >= limit)
break
i = i + 1