-
AutoCor: Spatial autocorrelation analysis (Moran)
Direct access to online help: AutoCor
Access the application from the menu: "Tools | Modeling and other analysis | Spatial autocorrelation analysis (Moran's I)"
Presentation
This application quantifies the degree of spatial autocorrelation of a variable in a raster dataset by computing Moran's I (i) index. Contiguity is calculated at order 1 (the first ring of neighbors for each cell, equivalent to a 3x3 cell window).
Spatial autocorrelation is a property of the spatial distribution of a variable whereby values at a given location are influenced by values at nearby locations (in accordance with Tobler's first law of Geography https://en.wikipedia.org/wiki/Tobler%27s_first_law_of_geography). The concept of "closeness" is represented by the autocorrelation threshold, defined as the distance beyond which spatial autocorrelation becomes negligible or non-existent. This threshold can be used to define appropriate spatial sampling conditions and to support the assumptions of associated statistical models.
Moran's I index is calculated with the following formula:
where:
is the number of spatial units, indexed by i and j;
is the variable of interest;
is the mean of the variable of interest;
is an element of a matrix of spatial weights with zeros on the diagonal;
is the sum of all the elements of the weight matrix, that is:
The weight matrix formed by the set of
can be defined based on the movement of either the rook or the queen in chess. In both cases, the matrix assigns a weight of 1 to neighboring cells in the north, south, east, and west directions. In the former case, a weight of 0 is assigned to the remaining (diagonal) directions, whereas in the latter case, a weight of 0.70711 (=1/√2) is assigned to these directions.
Spatial autocorrelation analysis makes it possible to distinguish between random and non-random spatial patterns, including highly regular arrangements such as a chessboard pattern. In the chessboard example, and applying the criterion of weights of 4 neighbors in a cross, the index obtained has a value of -1; on the other hand if all white squares occupy one half of the board and all black squares occupy the other half, Moran's I approaches +1 as the number of cells increases. Conversely, for a random arrangement of squares, Moran's I will be close to 0. Although values outside the interval [-1, +1] are theoretically possible, they usually occur in highly skewed distributions or in situations where some observations have very few neighbors within the analyzed distance.
NOTES:
- Calculating Moran's index requires variation in the data. If it is applied to a layer where all values are identical, the resulting index will be 0; however, in this case, concluding that the spatial distribution is random would be meaningless.
- Spatial autocorrelation is scale-dependent. Therefore, it is expected that a generalized layer (for example with CanviRes in contraction mode to obtain larger pixels based on a central value criterion) provides different values.
- This index should not be calculated for layers derived from rasters with larger cell sizes that have been converted into rasters with smaller cell sizes simply by subdividing the original cells (e.g., using the CanviRes application in expansion mode), as the subdivided layer introduces a fictitious contiguity between cells.
- When calculated using the 4-neighbor method on an image with a checkerboard pattern, the result is -1, as expected. Conversely, in 8-neighbor mode, autocorrelation increases significantly due to contact with the 4 diagonal neighbors; consequently, the index yields a value of -0.202709 for a 16x16 cell image (the fact that diagonal cells carry less weight prevents the value from being closer to zero).
- An alternative to Moran's index is to use the Variability option of Filters application, which provides a local measure of variability for each convolution window. In addition to generating an indicator sensitive to the variation within different areas, if all the values of the raster result of Filters are selected with a query by attributes, the median or the mean of the result will give a general value of the layer.
- To obtain an indicator similar to autocorrelation for images containing categorical variables, it is possible to follow this approach:
- Create a grid of regular polygons that tessellate the space. Then, using CombiCap tool in statistical field transfer mode, it is possible to calculate -among other metrics- the Shannon index for each polygon. The Shannon index is 0 for homogeneous regions and increases as the diversity of a region grows. In the resulting polygon layer, this index serves as a local indicator of diversity for each polygon. If all features are selected via an attribute-based query, the median or mean of the result will provide a general value for the layer.
- Using RasSelec application, select the category of interest and specify that the output should be a mask (selected cells will be marked as 1), ensuring that 0 is not designated as NoData (unselected cells will be marked as 0). Next, run AutoCor using this result. Optionally, this process can be performed for all categories, after which the median or mean of the various resulting values can be calculated.
Further information can be found in:

Dialog box of the application

Graphic examples
|
| Negative autocorrelation (competition between individuals, maximum dispersion), close to zero (practically random), and positive (in groups or clustered) |

Syntax
Syntax:
- AutoCor 1 InFile OutFile Weights
Options:
Parameters:
- InFile
(Input file -
Input parameter): Input raster dataset in IMG format.
- OutFile
(Output file -
Output parameter): Output report in INI format.
- Weights
(Weights matrix -
Input parameter):
- 1: Queen's case (8 neighbors).
- 2: Rook's case (4 neighbors).
