Description Usage Arguments Details Value Author(s) Examples
gp
Simulate a spatial Gaussian process given a certain covariance function.
1 2 |
coords |
A list of coordinates |
cor.model |
A character or function indicating the covariance function that Should be used to compute the variance-covariance matrix |
cor.params |
A list of the parameters required by the |
sigma2 |
variance of the Gaussian process |
size |
numeric value to simulate the covariate |
range |
Range of the coordinates of the Gaussian processes. |
geom |
object of class ‘sf’ or ‘sfc’ to define the area where to simulate the samples |
details.
A vector of the realization of the Gaussian Process
Erick A. Chacón-Montalván
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | (x <- gp(list(s1 = NA), size = 10))
(s1 <- x[[1]])
# Simulate and plot the realization of a Gaussian process
(y <- gp(list(s1), cor.model = "exp_cor", cor.params = list(phi = 0.05)))
(x <- gp(list(s1 = NA, s2 = NA), size = 10))
(s1 <- x[[1]])
(s2 <- x[[2]])
# Simulate and plot the realization of a Gaussian process
(y <- gp(list(s1, s2), cor.model = "exp_cor", cor.params = list(phi = 0.05)))
plot(s1, s2, cex = y)
# Plot with ggplot
# ggplot(data.frame(s1, s2, y), aes(s1, s2, col = y)) +
# geom_point(size = 3)
(x <- gp(list(s1 = "none", s2 = NA), size = 10))
(s1 <- x[[1]])
(s2 <- s1)
# Simulate and plot the realization of a Gaussian process
(y <- gp(list(s1, s2), cor.model = "exp_cor", cor.params = list(phi = 0.05)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.