on the way back without realtime
[talweg.git] / pkg / R / J_Persistence.R
index 8ac597c..a85a42a 100644 (file)
@@ -1,7 +1,8 @@
 #' Obtain jump forecast by the Persistence method
 #'
-#' @inheritParams getForecast
+#' @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))