-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct the cluster label of localG() #170
base: main
Are you sure you want to change the base?
Conversation
Please change your PR, and note that this implementation defines the quadrants from the input variable, not the standard variate of the local indicator. Indeed, GeoDa takes the mean of the local G values as the starting point: https://github.com/GeoDaCenter/libgeoda/blob/b512f742ff95fba89bbc9958972667c7643edba5/sa/UniG.cpp#L54-L110. It should not replace ´mean(x)´ by 0, but add extra vectors (maybe one for pysal based on standard deviate values, and one for Geoda based on the values of G), as in: Lines 47 to 56 in dbd3074
Lines 126 to 127 in dbd3074
Lines 63 to 75 in dbd3074
quadrant.type argument as in Lines 9 to 21 in dbd3074
Please also provide a full reproducible example using a standard data set, also with |
Thanks for your kind reply. |
The cluster label of localG() should be based on the z-score other than x.
(1)G
xi is not included in the G statistic of location i, so its cluster label has nothing to do with xi.
(2)Gstar
xi dose not have decisive impact on the Cluster label of location i.
For example, when the Gstar statistic of location i have significantly high value, but xi is slightly lower than mean(x), its cluster label should be "High" but not "Low".
(3)Rey et al.(2023) confirm that the cluster label of localG() should be based on the z-score other than x (p174-175) .
In p174, they say "When (G statistics) standardized, positive values imply clustering of high values, while negative implies grouping of low values."
The codes on p174-175 can also be referred.
Rey, S., Arribas-Bel, D., & Wolf, L.J. (2023). Geographic Data Science with Python (1st ed.). Chapman and Hall/CRC. https://doi.org/10.1201/9780429292507
p174
p175