View source: R/global_envelope_test.R
| global.envelope.test | R Documentation |
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.
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
)
X |
A numeric matrix or data frame with at least three columns giving |
sim.procedure |
Character string specifying the permutation strategy:
|
nsim |
Integer. Number of permutations for |
nblocks |
Integer (>= 2). Number of temporal blocks for block permutation.
Used only for |
nperm |
Integer. Number of block permutations for |
n.grid |
Integer/numeric vector of length 3 specifying grid resolution in |
s.region |
Numeric matrix with two columns specifying polygon vertices of the spatial window. |
t.region |
Numeric vector of length 2 specifying temporal window |
owin |
Optional window of class |
eps |
Optional numeric scalar (>0). Spatial bandwidth. If |
del |
Optional numeric scalar (>0). Temporal bandwidth. If |
tests |
Character vector indicating which diagnostics to test. Any of
|
GET.args |
Optional named list of extra arguments passed to
|
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.
A list with components:
Spatial bandwidth used.
Temporal bandwidth used.
For each requested test: p-values for ERL and AREA envelopes, plus optional plots if created.
Nafiseh Vafaei nafiseh.vafaei@slu.se
Mohammad Ghorbani mohammad.ghorbani@slu.se
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.
S.based.functions,
sim.procedures,
block.permut,
global_envelope_test,
plot.global_envelope
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.