Skip to content
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

add robust and informative condition for large magnitude projections (tests only off-diagonal) #113

Merged
merged 2 commits into from Jul 15, 2019

Conversation

renanxcortes
Copy link
Collaborator

@renanxcortes renanxcortes commented Jul 11, 2019

This PR is closely related to #96. This adds a more robust condition that raises for the user what is actually happening during the calculations.

@ljwolf shared with me an example using cenpy for a GeoDataFrame with a large unit for the centroid and realized that the RelativeClustering measure was behaving unexpectedly. It worked for Phoenix, but not for Tucson (was returning an NaN). However, in that case, even for Phoenix the index might be problematic since numerically the internal calculations are unstable. For Phoenix we got virtually zero for the exp(-d) of the distances:

image

And for Tucson we were having equal zero (therefore resulting in a NaN index):

image

The commit of this PR fix this and raises an informative ValueError better and perform a more assertive test than the old one.

@renanxcortes renanxcortes changed the title add robust and informative condition for large magnitude projections (tests only off-diagonal) [WIP] add robust and informative condition for large magnitude projections (tests only off-diagonal) Jul 11, 2019
@renanxcortes renanxcortes changed the title [WIP] add robust and informative condition for large magnitude projections (tests only off-diagonal) add robust and informative condition for large magnitude projections (tests only off-diagonal) Jul 11, 2019
@renanxcortes renanxcortes merged commit a7dd9b6 into pysal:master Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants