mgp: Simulate a Multivariate Gaussian process

Description Usage Arguments Details Value Author(s) Examples

Description

mgp Simulate a Multivariate spatial Gaussian process known as linear model of coregionalization Y(h) = AS(h), where S(h) is a vector of q independent Gaussian processes.

Usage

1
2
mgp(s1, s2, cov.model = NULL, variance = NULL, nugget = NULL,
  phi = NULL, kappa = 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

variance

A qxq matrix of non-spatial covariance.

nugget

A qxq diagonal matrix of non-spatial noise.

phi

A q-length vector of decay parameters.

kappa

A q-length vector of kappa parameters if Matern spatial correlation function is used.

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
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Generate coordinates
N <- 100
s1 <- 2 * runif(N)
s2 <- 2 * runif(N)

# Covariance parameters
q <- 2
var <- sqrt(diag(c(4, 4)))
A <- matrix(c(1, - 0.8, 0, 0.6), nrow = 2)
variance <- var %*% tcrossprod(A) %*% var
nugget <- diag(0, q)
phi <- rep(1 / 0.08, q)

# Generate the multivariate Gaussian process
y <- mgp(s1, s2, "exponential", variance, nugget, phi)
y1 <- y[1:N]
y2 <- y[(N + 1):(2 * N)]

# Check correlation
cor(y1, y2)
plot(y1, y2)

# Visualize the spatial
plot(s1, s2, cex = y1, col = 2)
points(s1, s2, cex = y2, col = 3)

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