View source: R/kernel_weights.R
| kernel_weights | R Documentation |
Compute kernel weights from distances
kernel_weights(distances, bandwidth, kernel = "bisquare")
distances |
Numeric vector of distances. |
bandwidth |
Positive numeric bandwidth. |
kernel |
Kernel type: "bisquare", "gaussian", or "tricube". |
A numeric vector with the same length as distances. Each element
is the spatial kernel weight assigned to the corresponding observation,
with larger weights generally assigned to observations closer to the focal
location.
distances <- c(0, 1, 2, 3)
kernel_weights(
distances = distances,
bandwidth = 3,
kernel = "bisquare"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.