simulate_obs_exact: Simulate Geospatial data given (x, y) locations

View source: R/simulate_data_xy.R

simulate_obs_exactR Documentation

Simulate Geospatial data given (x, y) locations

Description

Simulate Geospatial data given (x, y) locations

Usage

simulate_obs_exact(
  x,
  y,
  kernel = c("ugsm-s", "ugsmn-s", "bgsfm-s", "bgspm-s", "tgspm-s", "ugsm-st", "bgsm-st"),
  theta,
  dmetric = c("euclidean", "great_circle")
)

Arguments

x:

A vector (x-dim)

y:

A vector (y-dim)

kernel:

string - kernel ("ugsm-s", "ugsmn-s", "bgsfm-s", "bgspm-s", "tgspm-s", "ugsm-st", "bgsm-st")

theta:

list of n parameters (estimated theta)

dmetric:

A string - distance metric - "euclidean" or "great_circle"

Value

a list of three vectors (x, y, z)

Examples

kernel <- "ugsm-s"
theta <- c(1, 0.1, 0.5)                                     #Params vector.
dmetric <- "euclidean" ## "euclidean" or "great_circle" distance.
n <- 1600 ## The number of locations (n must be a square number, n=m^2)
x <- rnorm(n, 0, 1) # x measurements of n locations.
y <- rnorm(n, 0, 1) # y measurements of n locations.
exageostat_init(hardware = list(ncores = 2, ngpus = 0, ts = 320, lts = 0, pgrid = 1, qgrid = 1)) ## Initiate exageostat instance
data <- simulate_obs_exact(x, y, kernel, theta, dmetric) ## Generate Z observation vector based on given locations
data
exageostat_finalize() ## Finalize exageostat instance

ecrc/exageostatR documentation built on June 9, 2025, 9:06 p.m.