Monday, March 7, 2016

Matlab: Global Moran's I

Introduction

In statistics, Moran's I is a measure of spatial autocorrelation developed by Patrick Alfred Pierce Moran. Spatial autocorrelation is characterized by a correlation in a signal among nearby locations in space. Spatial autocorrelation is more complex than one-dimensional autocorrelation because spatial correlation is multi-dimensional (i.e. 2 or 3 dimensions of space) and multi-directional.
Negative/positive values indicate negative/positive spatial autocorrelation. Values range from -1 (indicating perfect dispersion) to 1 (perfect correlation). A zero value indicates a random spatial pattern. For statistical hypothesis testing, Moran’s I values can be transformed to z-scores in which values greater than 1.96 or smaller than -1.96 indicate spatial autocorrelation that is significant at the 5% level.
Fig. 1
Global Moran's I is defined as
\[I = \frac{n}{{{S_0}}}\frac{{\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {{w_{ij}}\left( {{x_i} - \overline x } \right)\left( {{x_j} - \overline x } \right)} } }}{{\sum\limits_{i = 1}^n {{{\left( {{x_i} - \overline x } \right)}^2}} }}\]
where wij is the weight between observation i and j, and S0 is the sum of all wij's, n is equal to the total number of pixels.
\[{S_0} = \sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {{w_{ij}}} } \]
The zI-score for the statistic is computed as:
\[{z_I} = \frac{{I - {\rm{E}}\left[ I \right]}}{{\sqrt {{\rm{V}}\left[ I \right]} }}\]
Where:
\[{\rm{E}}\left[ I \right] = \frac{{ - 1}}{{n - 1}}\] \[{\rm{V}}\left[ I \right] = {\rm{E}}\left[ {{I^2}} \right] - {\rm{E}}{\left[ I \right]^2}\] \[\begin{array}{c} {\rm{E}}\left[ {{I^2}} \right] = \frac{{A - B}}{C}\\ A = n\left[ {\left( {{n^2} - 3n + 3} \right){S_1} - n{S_2} + 3S_0^2} \right]\\ B = D\left[ {\left( {{n^2} - n} \right){S_1} - 2n{S_2} + 6S_0^2} \right]\\ C = \left( {n - 1} \right)\left( {n - 2} \right)\left( {n - 3} \right)S_0^2\\ D = \frac{{\sum\limits_{i = 1}^n {{{\left( {{x_i} - \overline x } \right)}^4}} }}{{{{\left( {\sum\limits_{i = 1}^n {{{\left( {{x_i} - \overline x } \right)}^2}} } \right)}^2}}}\\ {S_1} = \frac{1}{2}\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {{{\left( {{w_{ij}} + {w_{ji}}} \right)}^2}} } \\ {S_2} = \sum\limits_{i = 1}^n {{{\left( {\sum\limits_{j = 1}^n {{w_{ij}}} + \sum\limits_{j = 1}^n {{w_{ji}}} } \right)}^2}} \end{array}\]
the p-value for the null hypothesis is written as
\[p = {\rm{erfc}}\left( {\frac{{\left| {I - {\rm{E}}\left[ I \right]} \right|}}{{\sqrt {2{\rm{V}}\left[ I \right]} }}} \right)\]
this formula sources from Aki-Hiro Sato. Applied Data-Centric Social Sciences: Concepts, Data, Computation and Theory. Japan, Springer, 2014. pp. 137-138.
栅格数据的权重规则:In its simplest form, these weights will take values 1 for close neighbours, and 0 otherwise,按照三种邻接模式Rooks case, Bishops case, Queens case,分别计算Global Moran's I.
Fig. 2
ArcGIS计算栅格数据的Global Moran's I,首先将该栅格数据转换为Points(注意此处的栅格数据类型必须是整型,若是浮点型则先转换为整型数据),而后再按照要求配置参数,OK后等待输出结果。
代码计算Global Moran's I的栅格最好将数据类型由整型转换为浮点型,转换之后并不改变指数结果,但有益于代码计算。

References

No comments:

Post a Comment