Learn R Programming

SepTest (version 0.0.1)

get.lambda.function: Construct spatio-temporal intensity functions with controlled separability

Description

Returns an intensity function \(\lambda(x,y,t)\) corresponding to one of four models used for simulation experiments in Ghorbani et al. (2021). Each model is a mixture of a separable "background" component and a structured (generally non-separable) spatio-temporal Gaussian bump. The models provide different degrees of space–time separability, allowing for controlled experiments on separability testing.

Usage

get.lambda.function(
  N,
  g,
  model = 1L,
  mu1 = 0.5,
  sd1 = 0.2,
  mu2 = c(0.5, 0.5),
  sd2 = c(0.2, 0.2),
  mu3 = c(0.3, 0.3, 0.2),
  sd3 = c(0.05, 0.05, 0.05)
)

Value

A function of the form function(x, y, t) representing the selected intensity surface.

Arguments

N

Numeric scalar (> 0). Baseline intensity level (interpreted as an expected total count after scaling in the calling simulator; see details below).

g

Numeric scalar (>= 0). Weight of the structured (non-separable) component.

model

Integer in 1:4 indicating the structure of the intensity function.

mu1

Numeric scalar. Mean of the temporal Gaussian background term (models 2 and 4).

sd1

Numeric scalar (> 0). Standard deviation of the temporal Gaussian background term (models 2 and 4).

mu2

Numeric vector of length 2. Mean of the spatial 2D Gaussian background term (models 3 and 4).

sd2

Numeric vector of length 2 with positive entries. Standard deviations of the spatial 2D Gaussian background term (models 3 and 4).

mu3

Numeric vector of length 3. Mean of the structured (non-separable) 3D Gaussian component.

sd3

Numeric vector of length 3 with positive entries. Standard deviations of the structured 3D Gaussian component.

Author

Mohammad Ghorbani mohammad.ghorbani@slu.se
Nafiseh Vafaei nafiseh.vafaei@slu.se

Details

The returned function is intended for use in simulation (e.g., for generating spatio-temporal Poisson point patterns under varying degrees of separability).

The intensity is constructed as: $$\lambda(x,y,t) = \lambda_{\mathrm{bg}}(x,y,t) + g\, f_{st}(x,y,t),$$ where \(f_{st}\) is a nonnegative 3D Gaussian density (via norm3d) and the background term \(\lambda_{\mathrm{bg}}\) depends on model:

1

Homogeneous background: \(\lambda_{\mathrm{bg}}(x,y,t) = (N-g)\)

2

Temporal inhomogeneity only: \(\lambda_{\mathrm{bg}}(x,y,t) = (N-g)\, f_t(t)\), where \(f_t\) is a 1D Gaussian density (dnorm).

3

Spatial inhomogeneity only: \(\lambda_{\mathrm{bg}}(x,y,t) = (N-g)\, f_s(x,y)\), where \(f_s\) is a 2D Gaussian density (norm2d).

4

Separable spatial-temporal inhomogeneity: \(\lambda_{\mathrm{bg}}(x,y,t) = (N-g)\, f_s(x,y)\, f_t(t)\).

Note: since Gaussian densities can exceed 1 for small standard deviations, N is best interpreted as a scaling parameter used by the calling simulator. Ensure \(\lambda(x,y,t)\) is nonnegative over the intended domain.

See more details in Ghorbani et al. (2021), Section 6.1.

References

Ghorbani, M., Vafaei, N., Dvořák, J., and Myllymäki, M. (2021). Testing the first-order separability hypothesis for spatio-temporal point patterns. Computational Statistics & Data Analysis, 161, 107245.

See Also

rstpoispp, norm3d, norm2d, chi2.test, dHS.test

Examples

Run this code

# Choose model 4: non-separable spatio-temporal intensity
lambda <- get.lambda.function(N = 210, g = 50, model = 4)
lambda(0.5, 0.5, 0.5)  # Evaluate intensity at center of space-time domain

# Visualize spatial intensity at fixed time for model 2
lambda2 <- get.lambda.function(N = 200, g = 50, model = 2)
x <- y <- seq(0, 1, length.out = 100)
z <- outer(x, y, function(x, y) lambda2(x, y, t = 0.5))

fields::image.plot(
x, y, z,
main = "Intensity at t = 0.5 (Model 2)",
col = topo.colors(50))

Run the code above in your browser using DataLab