X-Git-Url: https://git.auder.net/images/assets/rpsls.css?a=blobdiff_plain;f=pkg%2FR%2FF_Neighbors.R;h=202b7e2472a4901f75f471391cf956b52d0294f0;hb=ff5df8e310b73883565761ab4b1aa5a0672e9f27;hp=238274bd5f8b1202ab601c8ecea5aad83fc4b578;hpb=98e958cab563866f8e00886b54336018a2e8bc97;p=talweg.git diff --git a/pkg/R/F_Neighbors.R b/pkg/R/F_Neighbors.R index 238274b..202b7e2 100644 --- a/pkg/R/F_Neighbors.R +++ b/pkg/R/F_Neighbors.R @@ -13,6 +13,10 @@ NeighborsForecaster = R6::R6Class("NeighborsForecaster", # (re)initialize computed parameters private$.params <- list("weights"=NA, "indices"=NA, "window"=NA) + # Do not forecast on days with NAs (TODO: softer condition...) + if (any(is.na(data$getCenteredSerie(today)))) + return (NA) + # Determine indices of no-NAs days followed by no-NAs tomorrows fdays = getNoNA2(data, max(today-memory,1), today-1)