spvar {gdverse} | R Documentation |
spatial variance
Description
Function for calculate inverse distance weight.
Usage
spvar(yn, wtn)
Arguments
yn |
The numerical vector of a response variable. |
wtn |
The spatial weight matrix. |
Details
The spatial variance formula is
\Gamma = \frac{\sum_i \sum_{j \neq i} \omega_{ij}\frac{(y_i-y_j)^2}{2}}{\sum_i \sum_{j \neq i} \omega_{ij}}
Value
A value of spatial variance.
Author(s)
Wenbo Lv lyu.geosocial@gmail.com
References
Xuezhi Cang & Wei Luo (2018) Spatial association detector (SPADE),International Journal of Geographical Information Science, 32:10, 2055-2075, DOI: 10.1080/13658816.2018.1476693
Examples
y = c(42,56,73)
wt1 = inverse_distance_weight(1:length(y),1:length(y))
wt2 = matrix(1,ncol = length(y),nrow = length(y))
diag(wt2) = 0
spvar(y,wt1)
spvar(y,wt2)
var(y)
[Package gdverse version 1.0.0 Index]