pysal / segregation

Segregation Measurement, Inferential Statistics, and Decomposition Analysis
https://pysal.org/segregation/
BSD 3-Clause "New" or "Revised" License
112 stars 26 forks source link

Adds SpatialMinMax index based on Sullivan and Wong (2007) #116

Closed renanxcortes closed 5 years ago

renanxcortes commented 5 years ago

This is PR is derived from https://github.com/pysal/segregation/pull/115 but comprising the changes raised in https://github.com/pysal/segregation/pull/115#pullrequestreview-261991906.

A very important thing to raise is that although it seems like in the paper O'Sullivan, David, and David WS Wong. "A surface‐based approach to measuring spatial segregation." Geographical Analysis 39.2 (2007): 147-168. the spatial smoothing is performed after the construction of the proportions of each group. We have a sense that this step should be performed before the calculations of the proportions and, therefore the resulting sums of the shares are 1 and therefore would represent a probability distribution as mentioned in the paper.

Therefore, https://github.com/pysal/segregation/commit/98d229461d378221b7a43c559e52c1fbe117e636 moves this step and the values slightly changed (tests were updated as well).

Another important thing to notice is that I also did some internal checkings locally using the other Equation (15) of the paper (pg. 155).

numerator = abs(density_1 - density_2).sum()
MM = numerator  / v_union

and used a negligible small bandwidth and indeed this numerator was equal to two times the raw dissimilarity index, which is the property expected at the beginning of page 156 of the referenced paper. This is not implemented (since this was just for internal check), but can be viewed below:

image