Skip to content

calculating G* for permutations in localG_perm #121

Closed

Description

@rosieluain

Hello,

I started digging into the code for localG_perm to make sure I am understanding the results correctly.

In the definition of the function permG_int, there is the line:

res_p <- lx_i/(x_star - xi)

I am calculating G*, but I believe this is the equation for G (not G*), which would mean that I am comparing my G* value to simulated G values. Should there be in an option within permG_int to calculate G* if gstari or self.included is TRUE?

Thanks!
Rosie

Activity

  1. rsbivand commented on Jan 23, 2023

    @rsbivand
    Member

    Thank you for checking. I'll take a look later in the week on return to Bergen. It is quite probable that the local G* case was not tested.

  2. rsbivand commented on Jan 26, 2023

    @rsbivand
    Member

    On looking at:

    spdep/R/lisa_perm.R

    Lines 293 to 294 in 1ec73bd

    if (gstari) res_p <- lx_i/x_star
    else res_p <- lx_i/(x_star-xi)

    the first line divides the nsim simulated lagged values by the sum of x, for the G-star case, and the second divides by the sum of x minus the value of x at i, so the regular G case.

  3. rosieluain commented on Jan 26, 2023

    @rosieluain
    Author

    Thank you - that code did not match the version I was using at all. I have now updated and the code matches and results are quite different. Sorry I did not check versions first - thank you!

  4. rsbivand commented on Jan 27, 2023

    @rsbivand
    Member

    Please note that I've opened #123 because of comparison with PySAL and Geoda; the current local G-star conditional permutation does not force the inclusion of the current observation in the lagged samples but perhaps should do so. Until #123 is resolved, conditional permutation of local G-star may diverge from the other two implementations.

  5. added a commit that references this issue on Apr 13, 2024
    c26e47c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions