Learn R Programming

SDPDmod (version 0.0.6)

InvDistMat: Inverse distance matrix

Description

This function calculates the inverse distances, with a given cutoff distance and a positive exponent.

Usage

InvDistMat(distMat, distCutOff = NULL, powr = 1, mevn = FALSE)

Value

W

weights matrix (Default, not normalized)

Arguments

distMat

distance matrix

distCutOff

cutoff distance. Default = the maximal value from the distance matrix.

powr

power (positive exponent), default = 1

mevn

logical, default FALSE. If TRUE, max-eigenvalue normalization is performed.

Author

Rozeta Simonovska

Details

W is an nxn matrix with elements \(w_{ij}\), i,j=1,..n, where \(w_{ij}=1/d_{ij}^\gamma\), if \(0 <= d_{ij} < D\) and \(w_{ij}=0\), if \(d_{ij} > D\) or \(i = j\). D is the distance cutoff point (maximum radius of influence), \(d_{ij}\) is the distance between spatial units i and j, and \(\gamma\) is the value for the exponent (e.g. \(\gamma\) = 1, 2, 3, 4,...).

Examples

Run this code
## distance between centroids of NUTS3 regions in Germany (in meters)
data(gN3dist, package = "SDPDmod")
## inverse distance matrix with cutoff 100000 meters
W1    <- InvDistMat(distMat = gN3dist, distCutOff = 100000)
dist2 <- gN3dist/1000 ##distance in km
## normalized distance matrix with cutoff 100km
W2    <- InvDistMat(distMat = dist2, distCutOff=100, powr = 2, mevn = TRUE)

Run the code above in your browser using DataLab