# space and time coordinates
n_t <- 50
n_sp <- 10
coords <- runif(n_sp ^ 2 * 2) * n_sp
dim(coords) <- c(n_sp ^ 2, 2)
time <- 1:n_t
st_coords <- as.matrix(expand.grid(1:nrow(coords), 1:length(time)))
st_coords <- cbind(coords[st_coords[, 1], ], time[st_coords[, 2]])
# different ring kernels and same lags
stkmat_r <- stkmat(coords = st_coords[, 1:2], time = st_coords[, 3],
kernel_type = 'ring',
kernel_parameters = list(c(0, 1), c(1, 2)), lags = c(1, 1))
# same ball kernels and different lags
stkmat_b <- stkmat(coords = st_coords[, 1:2], time = st_coords[, 3],
kernel_type = 'ball', kernel_parameters = 1:3, lags = c(1, 2, 3))
# different gauss kernels and different lags
stkmat_g <- stkmat(coords = st_coords[, 1:2], time = st_coords[, 3],
kernel_type = 'gauss', kernel_parameters = 1:3, lags = 1:3)
# mixed kernels
stkmat_m <- stkmat(coords = st_coords[, 1:2], time = st_coords[, 3],
kernel_type = c('ball', 'ring', 'gauss'),
kernel_parameters = list(1, c(1:2), 3), lags = 1:3)
Run the code above in your browser using DataLab