DistWMat function

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 meters W1 <- DistWMat(distMat = gN3dist, distCutOff = 100000) dist2 <- gN3dist/1000 ##distance in km ## normalized exponential distance matrix W2 <- DistWMat(distMat=dist2, distCutOff = 100, type = "expo", alpha = 2, mevn = TRUE)

See Also

InvDistMat ExpDistMat DDistMat vignette("spatial_matrices", package = "SDPDmod")

Author(s)

Rozeta Simonovska

  • Maintainer: Rozeta Simonovska
  • License: GPL (>= 3)
  • Last published: 2024-04-13

Useful links