
Monte Carlo test of space-time interaction
Source:R/SpaceTimeInteractionTest.R
SpaceTimeInteractionTest.RdWith the edge-corrected space-time K estimates of SpaceTimeK, the
statistic is \(T = \sum_{s,t} (K_{st}(s, t) - K_s(s) K_t(t))\), zero in
expectation when space and time are independent; its null distribution
comes from permuting the event times over the fixed locations, as
splancs::stmctest (Diggle et al. 1995). p-value
(1 + number of simulated T >= observed T) / (nsim + 1). Permutations are Fisher-Yates
shuffles from Philox stream k of seed, identical to the Python
arm (splancs uses sample). Pairs count at distance <= s and <= t in
every bin; splancs drops pairs exactly at the largest s or t, so the two
differ only when a pair distance ties a top grid value.