pysal / segregation

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

[ENH] Contribute Distortion Index (Olteanu and al. 2019) #142

Open ceciledebezenac opened 4 years ago

ceciledebezenac commented 4 years ago

Hello I am just opening this issue following a discussion with @darribas to contribute into segregation the statistic proposed in the following paper: (Olteanu and al. 2019) I have a working version in another repository here I and I just wanted to kick off the discussion on how to integrate it in, and have your advice on the process.

ljwolf commented 4 years ago

Yes! Rad! This would be wonderful; I'm a big fan of the paper :grin:

Taking a look at some small things that might help w/ maintenance, integration, & api consistency, we might want to make a few adjustments? It's real well documented & the code is very clean, so I think it should be simple to change a few things over.

Not sure how @renanxcortes or @knaaptime feel, but I spot these things we'd wanna do for integration/consistency. Renan/Eli, you know better about the actual API of the functions, which we might want to also make consistent w/ the other measures.

knaaptime commented 4 years ago

agree with Levi's points. also,

1) is pickle really required? if so, what for? 2) we have gini and lorenz implementations (but we might prefer your lorenz implementation) so we might want to think about how reconfigure these pieces to fit together without duplication

knaaptime commented 4 years ago

matplotlib is already a dependency, but might be good to move seaborn into the function

ceciledebezenac commented 4 years ago

Hello all, Thank you for going through the code so quickly! I totally agree with all that has been said, I paid very little attention to performance for computing the neighbourhood structure... I used pickle for my own analysis, but left it in the cleaner version for no particular reason. The scipy.special.kl_div method is great and would make the code a lot simpler.  Please let me know if there are other parts of it that are obscure...

ljwolf commented 4 years ago

Happy to help get this done :) this would be an awesome addition to the library!

knaaptime commented 4 years ago

also i just realized seaborn is a dependency elsewhere in the pysal stack (spvcm) so i'd be fine including it as a hard dependency here as well