# How to interpret spatial random permutations against the observed value of the statistic (PySAL)

I have a map for which I calculate the value of the Global Moran's I. With the use of PySAL, there is also an option to do a computational inference. The result of such analysis is shown below. From the videos I've seen and some papers I've read, what I understood from this is that random spatial permutations work like this:

1. I take my original map, shuffle the arrangement of the polygons
2. For each iteration, calculate the Moran's statistic
3. Do N times
4. Fit a curve to see the distribution of the simulated statistics
5. compare with the observed value of the statistic

In the figure above, my observed statistic is far to the right of the reference distribution.

Does this mean that, by simulating randomness, none of the configurations were able to come up with a value similar to that of the observed statistic? If so, does this mean that my map presents non-random patterns? Or does it mean that it is not probable to even have such a configuration/pattern?

Thanks for any info on this!

## 1 Answer

The idea behind the permutation is the following:

Under the null there is no spatial correlation in the data. A way of creating patterns of no spatial correlation (or complete spatial randomness to be formal) is simply by taking your observed values per polygon (or point) and randomly shuffle them. By doing so and given that you have a test statistic (the Moran's I in your context) you can calculate your test statistic for each random pattern. Thus you will have values of your test statistics that correspond to complete spatial randomness.

Now, if your observed value of the test statistics (the value that corresponds to your actual data) falls "well" within the distribution of the test statistics under the null, then you have weak evidence of spatial autocorrelation. If the value does not fall as in your case, then your data is indicative of spatial autocorrelation.

You can also calculate an empirical p-value based on your permutations. That would be 1 - sum(M_observed>M_permutations)/total number of permutations. M_observed is the observed value of Morans I whereas M_permutations a vector of the values of the Morans I for the given permutations.