R/weights.R
gda_kernel_knn_weights.Rd
Create a kernel weights by specifying k-nearest neighbors and a kernel method
gda_kernel_knn_weights(
geoda_obj,
k,
kernel_method,
adaptive_bandwidth = TRUE,
use_kernel_diagonals = FALSE,
power = 1,
is_inverse = FALSE,
is_arc = FALSE,
is_mile = TRUE
)
An instance of geoda
a positive integer number for k-nearest neighbors
a string value, which has to be one of 'triangular', 'uniform', 'epanechnikov', 'quartic', 'gaussian'
(optional) TRUE (default) or FALSE: TRUE use adaptive bandwidth calculated using distance of k-nearest neithbors, FALSE use max distance of all observation to their k-nearest neighbors
(optional) FALSE (default) or TRUE, apply kernel on the diagonal of weights matrix
(optional) The power (or exponent) of a number says how many times to use the number in a multiplication.
(optional) FALSE (default) or TRUE, apply inverse on distance value
(optional) FALSE (default) or TRUE, compute arc distance between two observations
(optional) TRUE (default) or FALSE, convert distance unit from mile to km.
An instance of Weight-class
if (FALSE) { # \dontrun{
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- geoda_open(guerry_path)
adptkernel_w = gda_kernel_knn_weights(guerry, 6, "uniform")
summary(adptkernel_w)
} # }