'update'
[talweg.git] / pkg / R / J_Zero.R
1 #' getZeroJumpPredict
2 #'
3 #' "Reset level to 0": jump by -A where A is the last observed value.
4 #'
5 #' @inheritParams computeForecast
6 #' @param today Index of the current day (predict tomorrow)
7 #' @param params Optional parameters computed by the main forecaster
8 #'
9 #' @aliases J_Zero
10 #'
11 getZeroJumpPredict = function(data, today, memory, predict_from, horizon, params, ...)
12 {
13 list(...)$first_pred - ifelse( predict_from >= 2,
14 data$getSerie(today)[predict_from-1], tail(data$getSerie(today-1),1) )
15 }