X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=pkg%2FR%2FJ_Neighbors.R;h=3c9bc30df25f21bd7b714f77c08d7f6ce4fea184;hb=546b0cb65870355a2a2c3705c91418570499d3a6;hp=03d334064a43f40d2d307e86e3f8b5c7e95cfafa;hpb=469529710f56c790ae932b45d13fed2e34bcabf2;p=talweg.git diff --git a/pkg/R/J_Neighbors.R b/pkg/R/J_Neighbors.R index 03d3340..3c9bc30 100644 --- a/pkg/R/J_Neighbors.R +++ b/pkg/R/J_Neighbors.R @@ -1,13 +1,15 @@ #' Obtain jump forecast by the Neighbors method #' -#' @inheritParams getForecast +#' @inheritParams computeForecast #' @inheritParams getZeroJumpPredict +#' getNeighborsJumpPredict = function(data, today, memory, horizon, params, ...) { first_day = max(1, today-memory) filter = params$indices >= first_day indices = params$indices[filter] weights = params$weights[filter] + if (any(is.na(weights) | is.na(indices))) return (NA)