1 #' getPersistenceJumpPredict
3 #' Analog of the PersistenceForecaster: predict the jump after last observed value either
4 #' by re-applying the last jump between similar day and its follower (if argument
5 #' "same_day" is TRUE), or by re-using the very last observed jump (when "same_day" =
8 #' @inheritParams computeForecast
9 #' @inheritParams getZeroJumpPredict
11 #' @aliases J_Persistence
13 getPersistenceJumpPredict = function(data, today, memory, predict_from,
16 #return gap between end of similar day curve and first day of tomorrow (in the past)
17 first_day = max(1, today-memory)
18 same_day = ifelse(hasArg("same_day"), list(...)$same_day, TRUE)
22 # If 'same_day', get the last known future of similar day
23 index = index - ifelse(same_day,7,1)
24 if (index < first_day)
27 if (predict_from >= 2)
28 data$getSerie(index)[predict_from] - data$getSerie(index)[predict_from-1]
30 head(data$getSerie(index),1) - tail(data$getSerie(index-1),1)