Skip to contents

Compares Besag's \(L(r) = \sqrt{K(r)/\pi}\) (isotropic K, \(\lambda^2 = n(n-1)/|W|^2\)) with its CSR value r over \(0 \le r \le\) rmax: the integrated squared deviation (Diggle-Cressie-Loosmore-Ford, \(u = \) rmax times the mean of \((L(r) - r)^2\) over the grid) or the maximum absolute deviation, exactly the statistics of spatstat.explore::dclf.test and mad.test with Lest and use.theo = TRUE. The null distribution comes from nsim binomial patterns drawn from Philox stream s of seed (identical to the Python arm); p-value (1 + number of simulated T >= observed T) / (nsim + 1).

Usage

CSRGlobalTest(
  points,
  window,
  nsim = 99L,
  seed = 1L,
  statistic = "dclf",
  rmax = NULL,
  nr = 513L
)

Arguments

points

Two-column matrix of coordinates.

window

c(xmin, xmax, ymin, ymax).

nsim

Number of simulated patterns.

seed

Philox seed.

statistic

"dclf" or "mad".

rmax

Upper end of the r interval (default the Kest rule).

nr

Number of r values.

Value

List with statistic, p_value, simulated, nsim, r, L, method.

References

Diggle, P. J. (1986). Displaced amacrine cells in the retina of a rabbit: analysis of a bivariate spatial point pattern. Journal of Neuroscience Methods 18, 115-125.

Loosmore, N. B. and Ford, E. D. (2006). Statistical inference using the G or K point pattern spatial statistics. Ecology 87, 1925-1931.

Examples

P <- cbind(c(.1, .4, .35, .8, .7, .55, .2, .9, .15, .6), c(.2, .8, .3, .6, .15, .5, .65, .9,
  .95, .85))
CSRGlobalTest(P, c(0, 1, 0, 1), nsim = 19, statistic = "mad")$p_value
#> [1] 0.05