global.envelope.test: Global envelope test for spatio-temporal separability using...

View source: R/global_envelope_test.R

global.envelope.testR Documentation

Global envelope test for spatio-temporal separability using S-function

Description

Performs a global envelope test of the null hypothesis of first-order separability for a spatio-temporal point process. The observed separability diagnostics S(u,t), S_{\mathrm{space}}(u) and/or S_{\mathrm{time}}(t) are compared to a reference distribution obtained from permuted versions of the data.

Usage

global.envelope.test(
  X,
  sim.procedure = c("pure_per", "block_per"),
  nsim = 25L,
  nblocks = 5L,
  nperm = 199L,
  n.grid = c(20L, 20L, 10L),
  s.region = matrix(c(0, 0, 1, 0, 1, 1, 0, 1), ncol = 2, byrow = TRUE),
  t.region = c(0, 1),
  owin = NULL,
  eps = NULL,
  del = NULL,
  tests = c("S.test", "S.space.test", "S.time.test"),
  GET.args = NULL
)

Arguments

X

A numeric matrix or data frame with at least three columns giving (x,y,t).

sim.procedure

Character string specifying the permutation strategy: "pure_per" or "block_per".

nsim

Integer. Number of permutations for "pure_per".

nblocks

Integer (>= 2). Number of temporal blocks for block permutation. Used only for "block_per".

nperm

Integer. Number of block permutations for "block_per".

n.grid

Integer/numeric vector of length 3 specifying grid resolution in x,y,t.

s.region

Numeric matrix with two columns specifying polygon vertices of the spatial window.

t.region

Numeric vector of length 2 specifying temporal window c(tmin,tmax).

owin

Optional window of class "owin" (from spatstat.geom). If supplied, values outside the window are set to NA (pixels mode).

eps

Optional numeric scalar (>0). Spatial bandwidth. If NULL, estimated internally.

del

Optional numeric scalar (>0). Temporal bandwidth. If NULL, estimated internally.

tests

Character vector indicating which diagnostics to test. Any of "S.test", "S.space.test", "S.time.test".

GET.args

Optional named list of extra arguments passed to global_envelope_test (e.g. alternative, savefuns, nstep).

Details

Two permutation strategies are supported:

"pure_per"

Pure permutation: randomly permutes the time coordinates.

"block_per"

Block permutation: permutes time in blocks to preserve short-range temporal dependence.

The GET package is used to construct global envelopes and compute p-values.

The null hypothesis is

H_0:\ \rho(u,t)=\rho_{\mathrm{space}}(u)\rho_{\mathrm{time}}(t).

The function computes the chosen diagnostics using S.based.functions on a pixel grid (at="pixels") and applies global_envelope_test.

To keep curve lengths identical (required by GET), any NA values induced by an owin mask are removed using the same indices for the observed and all simulated curves.

Value

A list with components:

Bandwidth_s

Spatial bandwidth used.

Bandwidth_t

Temporal bandwidth used.

S.test, S.space.test, S.time.test

For each requested test: p-values for ERL and AREA envelopes, plus optional plots if created.

Author(s)

Nafiseh Vafaei nafiseh.vafaei@slu.se
Mohammad Ghorbani mohammad.ghorbani@slu.se

References

Ghorbani, M., Vafaei, N., Dvořák, J., and Myllymäki, M. (2021). Testing the first-order separability hypothesis for spatio-temporal point patterns. Computational Statistics & Data Analysis, 161, 107245.

See Also

S.based.functions, sim.procedures, block.permut, global_envelope_test, plot.global_envelope

Examples


if (requireNamespace("GET", quietly = TRUE)) {
  set.seed(123)
  X <- cbind(stats::runif(100), stats::runif(100), stats::runif(100, 0, 1))
  s.region <- matrix(c(0,0, 1,0, 1,1, 0,1), ncol = 2, byrow = TRUE)
  t.region <- c(0, 1)

  res <- global.envelope.test(
    X = X,
    sim.procedure = "pure_per",
    nsim = 19,
    n.grid = c(10,10,10),
    s.region = s.region,
    t.region = t.region,
    tests = c("S.test","S.time.test")
  )
  str(res)
}


SepTest documentation built on Feb. 3, 2026, 5:07 p.m.