library(spatstat)
# Prepare the dataset:
X <- trees_N4
x_left <- x_left_N4
x_right <- x_right_N4
y_bottom <- y_bottom_N4
y_top <- y_top_N4
z_beta <- list(refor = cov_refor, slope = cov_slope)
# Determine the union of rectangles:
W <- owin(c(x_left[1], x_right[1]), c(y_bottom[1], y_top[1]))
if (length(x_left) >= 2){
for (i in 2:length(x_left)){
W2 <- owin(c(x_left[i], x_right[i]), c(y_bottom[i], y_top[i]))
W <- union.owin(W, W2)
}
}
# Dilated observation window:
W_dil <- dilation.owin(W, 100)
# Estimating the intensity function of the parent process:
aux <- first_step(X = X, z_beta = z_beta, W_dil = W_dil, plot = TRUE)
aux
Run the code above in your browser using DataLab