- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Closed
Description
Hi,
When I used ExaGeoStatCPP to simulate a set of spatial data, it always gave me a fixed pattern, although I didn't set a seed. Without a seed, we expect a random pattern/result.
Here I provide the code for generating a set of spatial data using ExaGeoStatCPP. Please repeat the code for several times, you could see the results are all the same.
%%R
library(assertthat)
library(ExaGeoStatCPP)
install.packages("fields")
install.packages("geoR")
library(fields)
library(geoR)
print("libraries assertthat, ExaGeoStatCPP, fields, and geoR loaded successfully!")
# Variables
dimension = "2D"
ncores <- 2
ngpus <- 4
dts <- 360
lts <- 0
computation <- "exact"
p <- 1
q <- 1
problem_size <- 5e3
kernel <- "univariate_matern_stationary"
initial_theta <- c(1,0.1,0.5)
# You need to provide a log_path to save the data.
log_path <- getwd()
# data path is where to read data from
# data_path <- paste(getwd(), "/synthetic_ds_Yan1/test1")
# observations file path is where to read observation file
# observations_file <- ""
# recovery file path is where to read recovery file
# recovery_file <- ""
hardware <- new(Hardware, computation, ncores, ngpus, p, q)
exageostat_data <- simulate_data(kernel=kernel, initial_theta=initial_theta, problem_size=problem_size, dts=dts, dimension=dimension, log_path=log_path)
quilt.plot(cbind(exageostat_data$x,exageostat_data$y),exageostat_data$m)
In comparison, please repeat the following code which generates spatial data using R package "geoR" to see the difference.
%%R
# set.seed(123)
geoR_data <- grf(n = 2000, grid = "irreg", cov.pars = c(1,0.1))
# Plot the simulated spatial data
quilt.plot(geoR_data$coords,geoR_data$data)
Metadata
Metadata
Assignees
Labels
No labels