X-Git-Url: https://git.auder.net/assets/rpsls.css?a=blobdiff_plain;ds=sidebyside;f=R%2FD_Persistence.R;fp=R%2FD_Persistence.R;h=0000000000000000000000000000000000000000;hb=e030a6e31232332b73187eda25870e843152c174;hp=979bf0533e9c45bdefde042e56d3c42828be37be;hpb=31f7d913d4a99d0a4db9bcfe40e31cebf90b22e6;p=talweg.git diff --git a/R/D_Persistence.R b/R/D_Persistence.R deleted file mode 100644 index 979bf05..0000000 --- a/R/D_Persistence.R +++ /dev/null @@ -1,22 +0,0 @@ -#' Obtain delta forecast by the Persistence method -#' -#' @inheritParams getForecast -#' @inheritParams getZeroDeltaForecast -getPersistenceDeltaForecast = function(data, today, memory, horizon, shape_params, ...) -{ - #return gap between end of similar day curve and first day of tomorrow (in the past) - first_day = max(1, today-memory) - index = today-7 - repeat - { - { - last_similar_serie_end = tail( data$getCenteredSerie(index), 1) - last_similar_tomorrow_begin = data$getCenteredSerie(index+1)[1] - index = index - 7 - }; - if (!is.na(last_similar_serie_end) && !is.na(last_similar_tomorrow_begin)) - return (last_similar_tomorrow_begin - last_similar_serie_end); - if (index < first_day) - return (NA) - } -}