dHS.test: dHSIC test for first-order separability of a spatio-temporal...

View source: R/Dhs_test.R

dHS.testR Documentation

dHSIC test for first-order separability of a spatio-temporal point process

Description

Performs a nonparametric test of first-order separability between space and time in a spatio-temporal point process using the d-variable Hilbert–Schmidt independence criterion (dHSIC). The test statistic evaluates whether the spatio-temporal intensity \rho(u,t) can be written in the multiplicative form \rho_1(u)\rho_2(t),\,\, (u,t)\in \mathbb{R}^2\times\mathbb{R}, where \rho_1 and \rho_2 are nonnegative measurable functions.

Usage

dHS.test(
  X,
  sim.procedure = c("pure_per", "block_per"),
  nblocks = 7L,
  nperm = 1999L,
  nsim = 199L,
  bandwidth = NULL
)

Arguments

X

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

sim.procedure

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

nblocks

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

nperm

Integer (>= 1). Number of block permutations (only for "block_per").

nsim

Integer (>= 1). Number of pure permutations (only for "pure_per").

bandwidth

Optional numeric. Fixed bandwidth to use with kernel = "gaussian.fixed" in dHSIC::dhsic. If a single value is provided, it is used for both the spatial and temporal variables. If a vector of length 2 is provided, it is interpreted as c(bw_space, bw_time). If provided, the function also returns a fixed-bandwidth Monte Carlo p-value. If NULL, only the adaptive-bandwidth Gaussian kernel (kernel = "gaussian") is used.

Details

Two permutation strategies are supported:

"pure_per"

Randomly permutes the time component across events.

"block_per"

Uses block-wise permutation of the time component via sim.procedures with method = "block" to preserve short-range temporal dependence.

The Monte Carlo p-value is computed with the standard +1 correction: (1 + \#\{T_i \ge T_{obs}\})/(B + 1), where B is the number of permutations.

Value

A list with components:

p.value

Monte Carlo p-value based on the adaptive-bandwidth Gaussian kernel.

p.value.bw

Monte Carlo p-value based on the fixed-bandwidth Gaussian kernel, or NA if bandwidth = NULL.

bandwidth_data

Bandwidth selected by dHSIC::dhsic(..., kernel = "gaussian").

Note

The dHSIC method is implemented via the dHSIC package. When sim.procedure = "pure_per", dHS.test() internally calls dhsic from R package dHSIC for computational efficiency.

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, block.permut, chi2.test

Examples

if (requireNamespace("dHSIC", quietly = TRUE)) {
  set.seed(123)
  X <- cbind(runif(100), runif(100), runif(100, 0, 10))

  # Pure permutation test
  result <- dHS.test(sim.procedure = "pure_per",
                     X = X, nsim = 199, bandwidth = 0.05)
  print(result$p.value)

  # Block permutation test
  result_block <- dHS.test(sim.procedure = "block_per", X = X,
                           nblocks = 5, nperm = 100, bandwidth = 0.05)
  print(result_block$p.value.bw)
}

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

Related to dHS.test in SepTest...