You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
calculating G* for permutations in localG_perm #121
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?
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.
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!
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.
Activity
rsbivand commentedon Jan 23, 2023
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.
rsbivand commentedon Jan 26, 2023
On looking at:
spdep/R/lisa_perm.R
Lines 293 to 294 in 1ec73bd
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.
rosieluain commentedon Jan 26, 2023
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!
rsbivand commentedon Jan 27, 2023
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.
fix r-spatial#121, add test