Samples SVCs on a regular quadratic (Cartesian) grid. The SVCs have all mean 0 and an exponential covariance function is used.
fullSVC_reggrid(m, p, cov_pars, nugget, seed = 123, given.locs = NULL)
(numeric(1)
)
Number of observations in one dimension, i.i, the square root number of
total number of observation locations
(numeric(1)
)
Number of SVCs.
(data.frame(p, 2)
)
Contains the covariance parameters of SVCs. The two columns must have the
names "var"
and "scale"
. These covariance parameters are
then used for sampling the respective SVCs.
(numeric(1)
)
Variance of the nugget / error term.
(numeric(1)
)
Seed set within the function for sampling.
(NULL
or data.frame(n, 2)
)
If NULL
, the observations locations are sampled from a regular grid,
Otherwise, the data.frame
contains the observation locations.
The data frame must have two columns of name "x"
and "y"
.
The number of observations is then the number of rows n
.
SpatialPointsDataFrame
(see SpatialPointsDataFrame-class
) of the sampled SVC
including the nugget.
# NOT RUN {
# number of SVC
p <- 3
# sqrt of total number of observations
m <- 20
# covariance parameters
(pars <- data.frame(var = c(0.1, 0.2, 0.3),
scale = c(0.3, 0.1, 0.2)))
nugget.var <- 0.05
# function to sample SVCs
sp.SVC <- fullSVC_reggrid(m = m, p = p,
cov_pars = pars,
nugget = nugget.var)
library(sp)
# visualization of sampled SVC
spplot(sp.SVC, colorkey = TRUE)
# }
Run the code above in your browser using DataLab