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