sim.procedures: Generate permuted versions (pure or block) of a...

View source: R/Simultion_procedure.R

sim.proceduresR Documentation

Generate permuted versions (pure or block) of a spatio-temporal point pattern

Description

Implements two types of permutation procedures for resampling the time component of spatio-temporal point process data:

"pure"

Pure random permutation of the time coordinates.

"block"

Block permutation where the time dimension is divided into consecutive blocks, and permutations are applied at the block level.

These procedures are used for generating surrogate datasets under the null hypothesis of first-order separability.

Usage

sim.procedures(X, nperm = 1999, nblocks = 4, method = c("block", "pure"))

Arguments

X

A numeric matrix or data frame with at least three columns, where the third column represents time.

nperm

Integer. The number of permuted datasets to generate.

nblocks

Integer. The number of temporal blocks to use for block permutation. Must be > 2.

method

Character. The permutation strategy to use. One of "pure" or "block".

Value

A list of nperm matrices. Each matrix is a permuted version of the original input X, where the third column (time) has been resampled based on the selected method.

Examples


set.seed(123)
X <- cbind(runif(100), runif(100), sort(runif(100)))

# Pure permutation
sims_pure <- sim.procedures(X, nperm = 10, method = "pure")
head(sims_pure[[1]])
# Block permutation
sims_block <- sim.procedures(X, nperm = 10, nblocks = 5, method = "block")

# Visualize the first result from block permutation
plot_stpp(sims_block[[1]], type = "3D")


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