The concept of a spatial weight is used in spatial analysis to describe neighbor relations between regions on a map. If location i {\displaystyle i} is a neighbor of location j {\displaystyle j} then w i j ≠ 0 {\displaystyle w_{ij}\neq 0} otherwise w i j = 0 {\displaystyle w_{ij}=0} . Usually (though not always) we do not consider a site to be a neighbor of itself so w i i = 0 {\displaystyle w_{ii}=0} . These coefficients are encoded in the spatial weight matrix
Where N {\displaystyle N} is the number of sites under consideration. The spatial weight matrix is a key quantity in the computation of many spatial indices like Moran's I, Geary's C, Getis-Ord statistics and Join Count Statistics.