gp: Simulate a Gaussian process

Description Usage Arguments Details Value Author(s) Examples

Description

gp Simulate a spatial Gaussian process given a certain covariance function.

Usage

1
gp(s1, s2, cov.model = NULL, cov.params = NULL)

Arguments

s1

First coordinate

s2

Second coordinate

cov.model

A character or function indicating the covariance function that Should be used to compute the variance-covariance matrix

cov.params

A list of the parameters required by the cov.model function.

Details

details.

Value

A vector of the realization of the Gaussian Process

Author(s)

Erick A. Chacon-Montalvan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Generate coordinates
N <- 1000
s1 <- 2 * runif(N)
s2 <- 2 * runif(N)
# Simulate and plot the realization of a Gaussian process
y <- gp(s1, s2, "exp_cov", list(phi = 0.05, sigma2 = 1))
plot(s1, s2, cex = y)
# Plot with ggplot
# ggplot(data.frame(s1, s2, y), aes(s1, s2, col = y)) +
#  geom_point(size = 3)

ErickChacon/day2day documentation built on May 6, 2019, 4:03 p.m.