X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=pkg%2FR%2FF_Neighbors.R;h=51b57304347c66faeb90528fa15428a5ec3b726b;hp=32d5cffc47a9bd043381ecb5d78cb56ced3e3b92;hb=689aa1d3c58e8b1e9fdfa9b895ca38c7228f56cc;hpb=4ba96933bd3eb63800ef9e98edbabe693aec7340 diff --git a/pkg/R/F_Neighbors.R b/pkg/R/F_Neighbors.R index 32d5cff..51b5730 100644 --- a/pkg/R/F_Neighbors.R +++ b/pkg/R/F_Neighbors.R @@ -28,6 +28,8 @@ #' obtain the final prediction. #' } #' +#' @usage f <- NeighborsForecaster$new(pjump) +#' #' @docType class #' @format R6 class, inherits Forecaster #' @aliases F_Neighbors @@ -216,16 +218,16 @@ NeighborsForecaster = R6::R6Class("NeighborsForecaster", ) ) -#' getConstrainedNeighbs -#' -#' Get indices of neighbors of similar pollution level (among same season + day type). -#' -#' @param today Index of current day -#' @param data Object of class Data -#' @param fdays Current set of "first days" (no-NA pairs) -#' @param min_neighbs Minimum number of points in a neighborhood -#' @param max_neighbs Maximum number of points in a neighborhood -#' +# getConstrainedNeighbs +# +# Get indices of neighbors of similar pollution level (among same season + day type). +# +# @param today Index of current day +# @param data Object of class Data +# @param fdays Current set of "first days" (no-NA pairs) +# @param min_neighbs Minimum number of points in a neighborhood +# @param max_neighbs Maximum number of points in a neighborhood +# .getConstrainedNeighbs = function(today, data, fdays, min_neighbs=10, max_neighbs=12) { levelToday = data$getLevel(today) @@ -252,13 +254,13 @@ NeighborsForecaster = R6::R6Class("NeighborsForecaster", fdays } -#' compute similarities -#' -#' Apply the gaussian kernel on computed squared distances. -#' -#' @param distances2 Squared distances -#' @param window Window parameter for the kernel -#' +# compute similarities +# +# Apply the gaussian kernel on computed squared distances. +# +# @param distances2 Squared distances +# @param window Window parameter for the kernel +# .computeSimils <- function(distances2, window) { sd_dist = sd(distances2)