Row-normalize a spatial weight matrix

Share:

Description

The function normw() row-normalizes a spatial weight matrix

Usage

1
normw(w)

Arguments

w

A matrix of size n x n

Details

W_ij=frac(W_(ij))(sum_kW_(ik))

Value

A matrix of size n x n

Author(s)

Aragon Y., Thomas-Agnan C., Ruiz-Gazen A., Robidou L.

References

Thibault Laurent, Anne Ruiz-Gazen, Christine Thomas-Agnan (2012), GeoXp: An R Package for Exploratory Spatial Data Analysis. Journal of Statistical Software, 47(2), 1-23.

See Also

neighbourmap, moranplotmap,makeneighborsw

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
###
# data auckland
data(auckland)
x.ext <- auckland$Easting[1:10]
y.ext <- auckland$Northing[1:10] 

# matrix based on 3 nearest neighbors
W1<-makeneighborsw(cbind(x.ext,y.ext),method="both",m=3,d=20)
W2<-normw(W1)

apply(W1[1:10,],1,sum)
apply(W2[1:10,],1,sum)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.