Description Usage Arguments Value Examples
Create a kernel weights by specifying k-nearest neighbors and a kernel method
1 2 3 4 5 6 7 8 9 10 11 |
geoda_obj |
An instance of geoda |
k |
a positive integer number for k-nearest neighbors |
kernel_method |
a string value, which has to be one of 'triangular', 'uniform', 'epanechnikov', 'quartic', 'gaussian' |
adaptive_bandwidth |
(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 |
use_kernel_diagonals |
(optional) FALSE (default) or TRUE, apply kernel on the diagonal of weights matrix |
power |
(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 value |
is_arc |
(optional) FALSE (default) or TRUE, compute arc distance between two observations |
is_mile |
(optional) TRUE (default) or FALSE, convert distance unit from mile to km. |
w An instance of Weight
1 2 3 4 | guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- geoda_open(guerry_path)
adptkernel_w = kernel_knn_weights(guerry, 6, "uniform")
summary(adptkernel_w)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.