View source: R/Block_permutation.R
| block.permut | R Documentation |
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.
block.permut(nblocks, X, nperm = 1999)
nblocks |
Integer (>= 2). Number of consecutive temporal blocks after ordering events by time. |
X |
Numeric matrix or data frame with at least three columns |
nperm |
Integer (>= 1). Number of permuted datasets to generate. At most
|
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.
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.
Ghorbani, M., Vafaei, N. and Myllymäki, M. (2025). A kernel-based test for the first-order separability of spatio-temporal point processes, TEST.
sim.procedures
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.