X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=pkg%2FR%2FForecaster.R;h=bb32a5e519cf65cdee11e5113ec5454e7c7882b3;hb=b58167f0785d6545caf2ed887720344e8ad2acd8;hp=da8579b7312bfcc520d8e2a8504202bb68ff2cbd;hpb=ff5df8e310b73883565761ab4b1aa5a0672e9f27;p=talweg.git diff --git a/pkg/R/Forecaster.R b/pkg/R/Forecaster.R index da8579b..bb32a5e 100644 --- a/pkg/R/Forecaster.R +++ b/pkg/R/Forecaster.R @@ -1,25 +1,46 @@ #' Forecaster #' -#' Forecaster (abstract class, implemented by all forecasters) +#' Forecaster (abstract class, implemented by all forecasters). #' -#' @docType class -#' @importFrom R6 R6Class +#' A Forecaster object encapsulates parameters (which can be of various kinds, for +#' example "Neighbors" method stores informations about the considered neighborhood for +#' the current prediction task) and one main function: \code{predictSerie()}. This last +#' function (by default) calls \code{predictShape()} to get a forecast of a centered +#' serie, and then calls the "jump prediction" function -- see "field" section -- to +#' adjust it based on the last observed values. +#' +#' @usage Forecaster$new(pjump) #warning: predictShape() is unimplemented #' -#' @field .params List of computed parameters, for post-run analysis (dev) -#' @field .pjump Function: how to predict the jump at day interface ? +#' @field .params List of computed parameters (if applicable). +#' @field .pjump Function: how to predict the jump at day interface? The arguments of +#' this function are -- in this order: +#' \itemize{ +#' \item data : object output of \code{getData()}, +#' \item today : index (integer or date) of the last known day in data, +#' \item memory : number of days to use in the past (including today), +#' \item horizon : number of time steps to predict, +#' \item params : optimized parameters in the main method \code{predictShape()}, +#' \item ... : additional arguments. +#' } +#' .pjump returns an estimation of the jump after the last observed value. #' #' @section Methods: #' \describe{ #' \item{\code{initialize(data, pjump)}}{ #' Initialize a Forecaster object with a Data object and a jump prediction function.} #' \item{\code{predictSerie(today,memory,horizon,...)}}{ -#' Predict a new serie of \code{horizon} values at day index \code{today} -#' using \code{memory} days in the past.} +#' Predict a new serie of \code{horizon} values at day index \code{today} using +#' \code{memory} days in the past.} #' \item{\code{predictShape(today,memory,horizon,...)}}{ -#' Predict a new shape of \code{horizon} values at day index \code{today} -#' using \code{memory} days in the past.} +#' Predict a new shape of \code{horizon} values at day index \code{today} using +#' \code{memory} days in the past.} #' \item{\code{getParameters()}}{ -#' Return (internal) parameters.}} +#' Return (internal) parameters.} +#' } +#' +#' @docType class +#' @format R6 class +#' Forecaster = R6::R6Class("Forecaster", private = list( .params = list(),