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

add bootstrap (for unit levels) for single value segregation #40

Closed renanxcortes closed 5 years ago

renanxcortes commented 5 years ago

This adds the bootstrap approach for single value. The size of the samples generated in each permutation is the same as the original sample size. Note that this resamples the units.... this could also be extended to generate samples from the individual. But I think that this current approach is already valuable to add in the module.

One thing that I noticed is that this approach is very sensitive to the sample size (which in our case is always fixed and the number of rows in the dataset... we could flexibilize that also), which might be a desired property. It is very likely that this approach generates distributions around the original sample estimate which, consequently, flagging not significant segregation measures. At least for eveness dimensions (dissimilarty, gini, etc.) I honestly think that our classical eveness approach suits better.

I think this is a good opportunity to discuss this in more details for an inference paper.

This is also implemented in OasisR (https://cran.r-project.org/web/packages/OasisR/OasisR.pdf) which I've been studying the internal functions. The results of this bootstrap approach of this PR is the same as OasisR.

renanxcortes commented 5 years ago

This addresses https://github.com/pysal/segregation/issues/38.