X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=pkg%2FR%2FF_Zero.R;h=4e1ae119865d7698063d51b8d1988e12a8bad0df;hb=dca259e4e9c0235cb113b329c27157ac59d7242b;hp=4f57ba2ae947f9c6a6c0483750e0e8c12c354b09;hpb=ff5df8e310b73883565761ab4b1aa5a0672e9f27;p=talweg.git diff --git a/pkg/R/F_Zero.R b/pkg/R/F_Zero.R index 4f57ba2..4e1ae11 100644 --- a/pkg/R/F_Zero.R +++ b/pkg/R/F_Zero.R @@ -1,13 +1,19 @@ -#' @include Forecaster.R -#' #' Zero Forecaster #' -#' Return 0 (and then adjust). Inherits \code{\link{Forecaster}} +#' Flat prediction: always forecast a serie of zeros. +#' This serie is then adjusted using the ".pjump" function (see \code{Forecaster} class). +#' +#' @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)) ) )