block.permut: Block permutation of the temporal component in a...

View source: R/Block_permutation.R

block.permutR Documentation

Block permutation of the temporal component in a spatio-temporal point pattern

Description

Permutes the temporal component of a spatio-temporal dataset in a block-wise manner while keeping the spatial coordinates fixed. This is used to generate permuted replicates under the null model of first-order separability.

Usage

block.permut(nblocks, X, nperm = 1999)

Arguments

nblocks

Integer (>= 2). Number of consecutive temporal blocks after ordering events by time.

X

Numeric matrix or data frame with at least three columns (x, y, t). Each row represents one event. The third column is interpreted as the time coordinate.

nperm

Integer (>= 1). Number of permuted datasets to generate. At most factorial(nblocks) - 1 distinct non-identity block permutations exist.

Details

The function first orders the events by time and partitions the ordered sequence into nblocks consecutive blocks of equal size. The block labels are permuted (excluding the identity permutation), and the time values are reassigned according to the permuted block order.

If nrow(X) is not divisible by nblocks, the last nrow(X) %% nblocks events are not included in the block permutation and are appended unchanged to each permuted dataset.

For details of the block permutation procedure, see the Supplementary Materials in Ghorbani et al. (2025).

Note that the sim.procedures covers both pure and block permutation methods.

Value

A list of length min(nperm, factorial(nblocks) - 1). Each element is a matrix with the same number of columns as X; the third column contains the block-permuted time values.

References

Ghorbani, M., Vafaei, N. and Myllymäki, M. (2025). A kernel-based test for the first-order separability of spatio-temporal point processes, TEST.

See Also

sim.procedures

Examples


set.seed(123)
X <- cbind(runif(100), runif(100), runif(100, 0, 10))
perms <- block.permut(nblocks = 5, X = X, nperm = 10)
head(perms[[1]], 5)


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