# Spatial Weights Matrices

## Introduction

In the measurement of autocorrelation, or in any kind of investigation of how things are related to each other in space, we need to be able to account for spatial relationships between all possible locations within our dataset (each row or observation in a table is almost always a location in a geospatial dataset). Because we are asking “how similar are the values of Variable 1 at locations A and B?”, we need to specify whether we consider Y and Z to be close to each other for our analysis. This is done using a spatial weights or spatial structure matrix generally denoted $$W$$.

$$W = \left[ {\begin{array}{cc} w_{i,i} & w_{i,j} & w_{i,k} &… & w_{i,n} \\ w_{j,i} & w_{j,j} & w_{j,k} &… & w_{i,n} \\ w_{k,i} & w_{k,j} & w_{k,k} &… & w_{k,n} \\ … &… &… &… &… \\ w_{n,i} & w_{n,j} & w_{n,k} &… & w_{n,n} \\ \end{array} } \right]$$

The first row of the matrix represents the spatial relationship between the first location $$i$$ and every other location in the datasets up to location $$n$$. Each $$w_{i,j}$$ value is dependent on the spatial relationship between locations $$i$$ and $$j$$ and on how we have determined that relationship.

## Types of Spatial Weights Matrices

There are three fundamental types of spatial weights matrices implemented in the AURIN Portal. Each of these are explained in their respective help pages.

## Standardisation

When you generate your spatial weights matrix based on, say a contiguity measure, it may look something like this:

$$W = \left[ {\begin{array}{cc} 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 1 \\ \end{array} } \right]$$

This is a binary form of a spatial weights matrix with 1 indicating locations that are contiguous and 0 indicating no contiguity. It is standard practice to standardise these matrices, so that locations that are contiguous with a large number of neighbours are not over-emphasised within the subsequent analysis.

For row standardisation, this is done by summing each row, and calculating the proportion that each value contributes to the row total, such as:

$$W = \left[ {\begin{array}{cc} 0 & 1 & 0 & 0 \\ 0 & 0 & 0.5 & 0.5 \\ 0.5 & 0.5 & 0 & 0 \\ 0 & 0.33 & 0.33 & 0.33 \\ \end{array} } \right]$$

For global standardisation, this is done by summing the total array, and calculating the proportion that each value contributes to the global total, such as:

$$W = \left[ {\begin{array}{cc} 0 & 0.125 & 0 & 0 \\ 0 & 0 & 0.125 & 0.125 \\ 0.125 & 0.125 & 0 & 0 \\ 0 & 0.125 & 0.125 & 0.125 \\ \end{array} } \right]$$

For the purposes of most spatial weights matrices, row standardisation is the more common option.