1 #' Obtain jump forecast by the Persistence method
3 #' @inheritParams getForecast
4 #' @inheritParams getZeroJumpPredict
5 getPersistenceJumpPredict = function(data, today, memory, horizon, params, ...)
7 #return gap between end of similar day curve and first day of tomorrow (in the past)
8 first_day = max(1, today-memory)
9 same_day = ifelse(hasArg("same_day"), list(...)$same_day, TRUE)
10 index = today - ifelse(same_day,7,1)
14 last_serie_end = tail( data$getSerie(index), 1)
15 last_tomorrow_begin = data$getSerie(index+1)[1]
16 index = index - ifelse(same_day,7,1)
18 if (!is.na(last_serie_end) && !is.na(last_tomorrow_begin))
19 return (last_tomorrow_begin - last_serie_end);
20 if (index < first_day)