Distance-based Kernel Spatial Weights
Create a kernel weights by specifying a bandwidth and a kernel method
kernel_weights( sf_obj, bandwidth, kernel_method, use_kernel_diagonals = FALSE, power = 1, is_inverse = FALSE, is_arc = FALSE, is_mile = TRUE )
sf_obj
: An sf (simple feature) objectbandwidth
: A positive numeric value of bandwidthkernel_method
: a string value, which has to be one of 'triangular', 'uniform', 'epanechnikov', 'quartic', 'gaussian'use_kernel_diagonals
: (optional) FALSE (default) or TRUE, apply kernel on the diagonal of weights matrixpower
: (optional) The power (or exponent) of a number says how many times to use the number in a multiplication.is_inverse
: (optional) FALSE (default) or TRUE, apply inverse on distance valueis_arc
: (optional) FALSE (default) or TRUE, compute arc distance between two observationsis_mile
: (optional) TRUE (default) or FALSE, convert distance unit from mile to km.An instance of Weight-class
library(sf) guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda") guerry <- st_read(guerry_path) bandwidth <- min_distthreshold(guerry) kernel_w <- kernel_weights(guerry, bandwidth, kernel_method = "uniform") summary(kernel_w)
Useful links