X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=pkg%2FR%2FJ_Persistence.R;h=a85a42a88ce76089d78491eae45c2d42d9ea6e25;hb=2057c793ad9929ed5bef8663ea28b896c84df0fc;hp=7a7daef1c4c242e7354a4300574d74892cb2e4bd;hpb=ff5df8e310b73883565761ab4b1aa5a0672e9f27;p=talweg.git diff --git a/pkg/R/J_Persistence.R b/pkg/R/J_Persistence.R index 7a7daef..a85a42a 100644 --- a/pkg/R/J_Persistence.R +++ b/pkg/R/J_Persistence.R @@ -2,6 +2,7 @@ #' #' @inheritParams computeForecast #' @inheritParams getZeroJumpPredict +#' getPersistenceJumpPredict = function(data, today, memory, horizon, params, ...) { #return gap between end of similar day curve and first day of tomorrow (in the past) @@ -12,7 +13,7 @@ getPersistenceJumpPredict = function(data, today, memory, horizon, params, ...) { { last_serie_end = tail( data$getSerie(index), 1) - last_tomorrow_begin = data$getSerie(index+1)[1] + last_tomorrow_begin = head( data$getSerie(index+1), 1) index = index - ifelse(same_day,7,1) }; if (!is.na(last_serie_end) && !is.na(last_tomorrow_begin))