Learn R Programming

SDPDmod (version 0.0.6)

ExpDistMat: Exponential distance matrix

Description

This function calculates the (negative) exponential distance matrix, with a given cutoff distance and a positive exponent value.

Usage

ExpDistMat(distMat, distCutOff = NULL, expn = 0.01, mevn = FALSE)

Value

W

spatial weights matrix (Default, not normalized)

Arguments

distMat

distance matrix

distCutOff

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

expn

positive exponent, default = 0.01

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}=e^{-\alpha d_{ij}}\), 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 \(\alpha\) is the positive exponent (e.g. \(\alpha\)= 0.01, 0.02,...).

Examples

Run this code
data(gN3dist) ##distance in meters
W1    <- ExpDistMat(distMat = gN3dist, distCutOff = 100000)
dist2 <- gN3dist/1000 ##in km
W2    <- ExpDistMat(distMat = dist2, distCutOff = 100, expn = 0.02)
W2nor <- ExpDistMat(distMat = dist2, 100000, 0.001, mevn = TRUE)

Run the code above in your browser using DataLab