GeoDaCenter / rgeoda

R library for spatial data analysis based on libgeoda and GeoDa
73 stars 14 forks source link

add permutation_method={"brutal-force", "lookup-table"} in lisa.R #13

Closed lixun910 closed 3 years ago

lixun910 commented 3 years ago

e.g.

nat <- st_read("./data/natregimes.shp")
w <- queen_weights(nat)
lm1 <- local_moran(w, nat["HR70"], permutations = 9999, ppermutation_method = "lookup-table")
lm2 <- local_moran(w, nat["HR70"], permutations = 9999)
plot(lm1$p_vals, lm2$p_vals)

system.time(lm2 <- local_moran(w, nat["HR70"], permutations = 9999))
system.time(lm1 <- local_moran(w, nat["HR70"], permutations = 9999, permutation_method = "lookup-table"))

0.076 vs 0.906 seconds

image