if (FALSE) {
library("NeuralEstimators")
# Number of data sets, number of replicates in each data set, and spatial dimension
K <- 15
m <- 5
d <- 2
# Spatial locations fixed for all replicates within a given data set
n <- 100
S <- lapply(1:K, function(k) matrix(runif(n * d), n, d))
Z <- lapply(1:K, function(k) runif(n))
g <- spatialgraphlist(S, Z)
# Spatial locations varying between replicates within a given data set
S <- lapply(1:K, function(k) {
lapply(1:m, function(i) {
ni <- sample(50:100, 1) # Randomly generate the number of locations for each replicate
matrix(runif(ni * d), ni, d) # Generate the spatial locations
})
})
Z <- lapply(1:K, function(k) {
lapply(1:m, function(i) {
n <- nrow(S[[k]][[i]])
runif(n)
})
})
g <- spatialgraphlist(S, Z)
}
Run the code above in your browser using DataLab