Distance weights matrix (Inverse distance, Exponential distance or Double-Distance matrix)
Distance weights matrix (Inverse distance, Exponential distance or Double-Distance matrix)
This function calculates the spatial distance weights matrix (inverse, exponential or double-distance), with a given cutoff distance and a positive exponent (alpha).
DistWMat( distMat, distCutOff =NULL, type ="inverse", alpha =NULL, mevn =FALSE)
Arguments
distMat: distance matrix
distCutOff: cutoff distance. Default = the maximal value from the distance matrix.
type: the type of distance matrix c("inverse","expo","doubled"). Default = "inverse".
alpha: power (positive exponent), default 1 if type="inverse", 0.01 if type="expo" and 2 if type="double"
mevn: logical, default FALSE. If TRUE, max-eigenvalue normalization is performed.
Returns
W: spatial weights matrix (Default, not normalized)
Examples
## distance between centroids of NUTS3 regions in Germany (in meters)data(gN3dist, package ="SDPDmod")##inverse distance matrix with cutoff 100000 metersW1 <- DistWMat(distMat = gN3dist, distCutOff =100000)dist2 <- gN3dist/1000##distance in km## normalized exponential distance matrixW2 <- DistWMat(distMat=dist2, distCutOff =100, type ="expo", alpha =2, mevn =TRUE)