X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=R%2FF_Persistence.R;fp=R%2FS_Persistence.R;h=f0784840ec6ac74d6db81713cad32cff02d626ae;hp=08647e31b113cd2f4c029987419551fde2ecd831;hb=e030a6e31232332b73187eda25870e843152c174;hpb=31f7d913d4a99d0a4db9bcfe40e31cebf90b22e6 diff --git a/R/S_Persistence.R b/R/F_Persistence.R similarity index 66% rename from R/S_Persistence.R rename to R/F_Persistence.R index 08647e3..f078484 100644 --- a/R/S_Persistence.R +++ b/R/F_Persistence.R @@ -1,19 +1,19 @@ -#' @include ShapeForecaster.R +#' @include Forecaster.R #' -#' @title Persistence Shape Forecaster +#' @title Persistence Forecaster #' #' @description Return the last centered last (similar) day curve. -#' Inherits \code{\link{ShapeForecaster}} -PersistenceShapeForecaster = setRefClass( - Class = "PersistenceShapeForecaster", - contains = "ShapeForecaster", +#' Inherits \code{\link{Forecaster}} +PersistenceForecaster = setRefClass( + Class = "PersistenceForecaster", + contains = "Forecaster", methods = list( initialize = function(...) { callSuper(...) }, - predict = function(today, memory, horizon, ...) + predictShape = function(today, memory, horizon, ...) { #return centered last (similar) day curve, avoiding NAs until memory is run first_day = max(1, today-memory)