library(spatstat)
# Unit square observation window:
W <- owin()
# Dilation of the observation window:
W_dil <- dilation(W, 0.1)
W_dil <- as.mask(W_dil)
# Define covariates:
f1 <- function(x, y) { x }
f2 <- function(x, y) { y }
f3 <- function(x, y) { 1 - (y - 0.5) ^ 2 }
cov1 <- as.im(f1, W = W_dil)
cov2 <- as.im(f2, W = W_dil)
cov3 <- as.im(f3, W = W_dil)
# Stationary Thomas process:
X <- rThomasInhom(kappa = 50, alpha = log(10), omega = log(0.01),
W = W, W_dil = W_dil)
plot(X)
# Thomas-type cluster process with inhomogeneity in all model components:
X <- rThomasInhom(kappa = 10, betavec = c(1), z_beta = list(cov1),
alpha = log(10), alphavec = c(1), z_alpha = list(cov2),
omega = log(0.01), omegavec = c(1), z_omega = list(cov3),
W = W, W_dil = W_dil)
plot(X)
Run the code above in your browser using DataLab