morie_morans_i is the statistic
I = (n/S0) * (z' W z) / (z'z) with z = x - mean(x).
morie_morans_i_test mirrors spdep::moran.test: under the null
E[I] = -1/(n-1) and the variance takes the randomisation form
(conditioning on the observed values, treating only their
arrangement as random) or the normality form.
Value
morie_morans_i a number; morie_morans_i_test a list with
estimate, expectation, variance, statistic and p_value
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_morans_i(V, V)
#> [1] -0.7777778 -0.5555556 -0.3333333 -0.1111111 0.1111111 0.3333333 0.5555556
#> [8] 0.7777778
