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

allow permutations array via overloading #348

Closed
wants to merge 4 commits into from

Conversation

ljwolf
Copy link
Member

@ljwolf ljwolf commented Aug 15, 2024

This applies @martirenom's wonderful #345 as an extension to the permutations argument, rather than as a separate argument. Hopefully this can illustrate what I have outlined in the review on #345.

I am particularly excited about this feature, since it will let us represent hypotheses for block-wise shuffling, like shuffling only counties within states.

martirenom and others added 4 commits July 31, 2024 16:49
This allows users to define a custom permutations array for the Moran_Local class to be used in crand. This is useful for custom applications.
Added new tests for the permutations_array argument in Moran_Local and crand.
Fixed some test that were broken due to the new argument.
@martinfleis
Copy link
Member

Yeah, this is what I had in mind when suggesting permutations overlaod in #344. Looks good to me!

@martirenom
Copy link

Thanks @ljwolf! We initially tried your @martinfleis suggestion but, not knowing the code in detail, entered in all sort of problems where permutations was used in other parts of the code. Thus, decided to have a new array passed. However, your solution is clearly more elegant.

As for an example where this applies. I have to admit that we are not in the field of geo-statistics. We are using LMI in genomics where we generate "maps" of the Human genome and identify spatial correlations of all sort of data. This is implemented in our python library METALoci (https://github.com/3DGenomes/METALoci) that uses esda. Since the genome has linearity (that is, one gene up-stream is connected to the next gene down-stream), we needed a different shuffling that would take into consideration this.

If I try to extrapolate to cases in your field, I could imaging that you may want to maintain cities connected if they are all in the same road so that they may need to be shuffled together.

@ljwolf ljwolf closed this Aug 15, 2024
@ljwolf
Copy link
Member Author

ljwolf commented Aug 15, 2024

closing as I've pushed it onto @martirenom's #345

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