Skip to contents

A weight rather than a cut-off, because any threshold is arbitrary and a plot just past it is not meaningfully different from one just inside. bandwidth is the distance at which a Gaussian weight falls to about 0.61; it is the one number to tune, and it can be chosen by cross-validation.

Usage

growth_climatic_weight(
  distance,
  bandwidth = 0.5,
  kernel = c("gaussian", "tricube", "uniform")
)

Arguments

distance

Numeric, from growth_climatic_distance().

bandwidth

Numeric. Scale over which similarity decays.

kernel

One of "gaussian" (smooth, never exactly zero), "tricube" (smooth, zero beyond bandwidth) or "uniform" (a hard cut-off at bandwidth).

Value

A numeric vector of weights in [0, 1].