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

[WIP] Ch7 dab lastpass #227

Merged
merged 11 commits into from
Feb 11, 2022
Merged

[WIP] Ch7 dab lastpass #227

merged 11 commits into from
Feb 11, 2022

Conversation

darribas
Copy link
Member

Not to merge yet.

@darribas darribas requested a review from ljwolf January 21, 2022 15:22
@darribas
Copy link
Member Author

OK, on dcfdc5a I have a couple of updates that I'd love if @sjsrey and/or @ljwolf could have a look at as I'm a bit unsure about what I'm getting:

a) I've added the code for the local joint counts but, since it's the first time I'm actually applying the statistic and the results are not necessarily what I'd expect from the general narrative around Brexit (eg. NE of England Leave cluster), I could use with a bit of help sane checking what I'm getting is correct/OK

b) I now have a working example for the raster LISA that returns something a bit more sensible to me. @ljwolf the issue seems to be again on the handling of different types (xref libpysal#446), but I could use another pair of eyes to confirm this looks OK and the issue is then on libpysal's handling of dtypes.

Once this is more or less stable/understood, I'll move on with building the narrative around these two sections, but that should be a pretty straightforward affair.

@ljwolf
Copy link
Member

ljwolf commented Feb 2, 2022

I'm going to say no on the LJC. Something is off to me, and I need time to dig into it. I was concerned that you're detecting a leave cluster for many places that voted remain. I'm not sure if the implementation of the statistic is off (I tried estimating the statistic after resetting the db index and rebuilding the weights... got a "slice mismatch" error from numba) or if the issue is in our interpretation, but I'd say that I'm not cool w/ including it until I understand why areas that vote remain are getting called leave clusters.

@ljwolf
Copy link
Member

ljwolf commented Feb 3, 2022

OK, I believe I have resolved the issue with the rasters. It seems to me that the p-value threshold was not set correctly, and this was affecting the generation of the cluster map. Lowering the threshold back down to .01 gives a cluster map that conforms to my expectations:
index

@sjsrey
Copy link
Contributor

sjsrey commented Feb 3, 2022

This looks a lot more aligned than what I saw last week.

If I play around with the significance level, things continue to be aligned on the left and right figures. So I think this is sorted.

I'm not sure what the original data is so I can't comment, but if it is interpolated population data we might want to add a note about induced spatial dependence?

@ljwolf
Copy link
Member

ljwolf commented Feb 4, 2022

do not forget to add image captions!

@ljwolf
Copy link
Member

ljwolf commented Feb 4, 2022

After working on the LJC this afternoon, I still cannot get it to work with the symmetrized knn weights. it does work with the queen weights. I am not sure why.

With the symmetric KNN, I'm still getting LJC > 0 for cases where y = 0. This should never happen, as y==1 is a prerequisite for there to be any 1-1 joins.

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.

3 participants