X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=pkg%2FR%2FF_Zero.R;h=21e6e006749cd623dbb8f824b3235aceb7fca2f5;hb=4f3fdbb8e2ac4bd57a4e27539a58ef0e7ec2304c;hp=4f57ba2ae947f9c6a6c0483750e0e8c12c354b09;hpb=ff5df8e310b73883565761ab4b1aa5a0672e9f27;p=talweg.git diff --git a/pkg/R/F_Zero.R b/pkg/R/F_Zero.R index 4f57ba2..21e6e00 100644 --- a/pkg/R/F_Zero.R +++ b/pkg/R/F_Zero.R @@ -1,13 +1,18 @@ -#' @include Forecaster.R -#' #' Zero Forecaster #' -#' Return 0 (and then adjust). Inherits \code{\link{Forecaster}} +#' Flat prediction: always forecast a serie of zeros (adjusted by 'pjump' function). +#' +#' @usage # ZeroForecaster$new(pjump) +#' +#' @docType class +#' @format R6 class, inherits Forecaster +#' @aliases F_Zero +#' ZeroForecaster = R6::R6Class("ZeroForecaster", inherit = Forecaster, public = list( - predictShape = function(data, today, memory, horizon, ...) - rep(0., horizon) + predictShape = function(data, today, memory, predict_from, horizon, ...) + rep(0, (horizon-predict_from+1)) ) )