S.based.functions: Compute S-based test function for testing the null hypothesis...

View source: R/SBasedFun.R

S.based.functionsR Documentation

Compute S-based test function for testing the null hypothesis of first-order separability

Description

Computes kernel-based estimates of the spatio-temporal intensity and related separability diagnostics, either on a regular spatio-temporal grid ("pixels") or at the observed event locations ("points").

Usage

S.based.functions(
  X,
  s.region,
  t.region,
  owin = NULL,
  at = c("pixels", "points"),
  n.grid = c(25L, 25L, 20L),
  epsilon = NULL,
  delta = NULL,
  output = "all"
)

Arguments

X

Numeric matrix/data.frame with three columns giving (x,y,t).

s.region

Numeric matrix with two columns giving polygon vertices of the spatial window.

t.region

Numeric vector of length 2 giving the temporal window c(tmin, tmax).

owin

Optional spatial window of class "owin" (from spatstat.geom). Used only when at="pixels" to set values outside the window to NA.

at

Character string: "pixels" or "points".

n.grid

Integer vector of length 3 giving the grid resolution in x, y, and t (used when at="pixels"; still checked for length/positivity in both modes).

epsilon

Optional numeric scalar (>0). Spatial bandwidth. If NULL, estimated internally.

delta

Optional numeric scalar (>0). Temporal bandwidth. If NULL, estimated internally.

output

Character string selecting which component to return. Use "all" (default) to return all available components; otherwise return only the selected component along with bandwidths and coordinates.

Details

The function is a wrapper that (i) validates inputs, (ii) computes bandwidths and Gaussian edge-correction masses via calc.bandwidths.and.edgecorr, and (iii) delegates the actual estimation to estimate.intensity.pixel or estimate.intensity.point.

When at="points", spatial/temporal profiles such as S.space and S.time are typically not defined and are returned as NULL by the pointwise routine.

Value

If output="all", returns the full list produced by the chosen computation routine, augmented with epsilon and delta.

If output is a single component name, returns a list with:

S

The requested component.

epsilon

Spatial bandwidth used.

delta

Temporal bandwidth used.

x,y,t

Coordinates returned by the underlying routine (may be NULL).

Examples


X <- cbind(stats::runif(50), stats::runif(50), stats::runif(50))
s.region <- matrix(c(0,0, 1,0, 1,1, 0,1), ncol = 2, byrow = TRUE)
t.region <- c(0, 1)
res_all <- S.based.functions(X, s.region, t.region, at = "points")
res_Sfun <- S.based.functions(X, s.region, t.region, at = "points", output = "S.fun")


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