
Monte Carlo spatial test by random relabelling
Source:R/MonteCarloSpatialTest.R
monte_carlo_spatial_test.RdRecomputes a spatial statistic on n_sim random permutations of the
values over the fixed locations and ranks the observed value among them
(Besag and Diggle 1977). The default statistic is Moran's I with
inverse-distance weights; a statistic that ignores the locations is
permutation-invariant and can never reject. Permutations are Fisher-Yates
shuffles on the package's Philox stream. Identical to the Python arm
morie.fn.sgmci.monte_carlo_spatial_test.
Value
A list with value and observed (the statistic),
envelope_lo, envelope_hi (2.5 and 97.5 percent points of the
permutation distribution), p_value (upper tail),
p_two_sided, n_sim, sim_mean, significant
and statistic.