Learn R Programming

SpatialExtremes (version 2.0-7)

condrmaxlin: Conditional simulation of max-linear random fields

Description

This function generates (approximate) conditional simulation of unit Frechet max-linear random fields. It can be used to get approximate conditional simulation for max-stable processes.

Usage

condrmaxlin(n, coord, data.coord, data, cov.mod = "gauss", ..., grid =
FALSE, p = 10000)

Arguments

n

Integer. The number of conditional simulations.

coord

A numeric vector or matrix specifying the coordinates where the process has to be generated. If coord is a matrix, each row specifies one locations.

data.coord

A numeric vector or matrix specifying the coordinates where the process is conditioned.

data

A numeric vector giving the conditioning observations.

cov.mod

A character string specifying the max-stable model. See section Details.

The parameters of the max-stable model. See section Details.

grid

Logical. Does coord defines a grid?

p

An integer. The number of unit Frechet random variables used in the max-linear approximation.

Value

A matrix containing observations from the required max-stable model. Each column represents one stations. If grid = TRUE, the function returns an array of dimension nrow(coord) x nrow(coord) x n.

Warnings

It may happen that some conditional observations are not honored because the approximation of a max-stable process by a max-linear one isn't accurate enough! Sometimes taking a larger p solves the issue.

Details

Any unit Frechet max-stable processes \(\{Z(x)\}\) can be approximated by a unit Frechet max-linear process, i.e., $$Z(x) \approx \max_{j=1, \ldots, p} f_j(x) Z_j,$$ where \(f_j\) are non-negative deterministic functions, \(p\) is a sufficiently large integer and \(Z_j\) are independent unit Frechet random variables. Note that to ensure unit Frechet margins, the following condition has to be satisfied $$\sum_{j=1, \ldots, p} f_j(x) = 1,$$ for all \(x\).

Currently only the discretized Smith model is implemented for which \(f_j(x) = c(p) \varphi(x - u_j ; \Sigma)\) where \(\varphi(\cdot; \Sigma)\) is the zero mean (multivariate) normal density with covariance matrix \(\Sigma\), \(u_j\) is a sequence of deterministic points appropriately chosen and \(c(p)\) is a constant ensuring unit Frechet margins.

References

Wang, Y. and Stoev, S. A. (2011) Conditional Sampling for Max-Stable Random Fields. Advances in Applied Probability.

See Also

rmaxstab, condrmaxlin

Examples

Run this code
# NOT RUN {
## One dimensional conditional simulations
n.cond.site <- 10
cond.coord <- runif(n.cond.site, -10, 10)
data <- rmaxlin(1, cond.coord, var = 3, p = 10000)

x <- seq(-10, 10, length = 250)
cond.sim <- condrmaxlin(5, x, cond.coord, data, var = 3)

matplot(x, t(log(cond.sim)), type = "l", lty = 1, pch = 1)
points(cond.coord, log(data))

## Two dimensional conditional simulation
cond.coord <- matrix(runif(2 * n.cond.site, -10, 10), ncol = 2)
data <- rmaxstab(1, cond.coord, "gauss", cov11 = 4, cov12 = 0, cov22 = 4)

x <- y <- seq(-10, 10, length = 75)
cond.sim <- condrmaxlin(4, cbind(x, y), cond.coord, data, cov11 = 4,
cov12 = 0, cov22 = 4, grid = TRUE, p = 2000)
## Note p is set to 2000 for CPU reasons but is likely to be too small

op <- par(mfrow = c(2, 2), mar = rep(1, 4))
for (i in 1:4){
image(x, y, log(cond.sim[,,i]), col = heat.colors(64), xaxt = "n", yaxt
= "n", bty = "n")
contour(x, y, log(cond.sim[,,i]), add = TRUE)
text(cond.coord[,1], cond.coord[,2], round(log(data), 2), col = 3)
}
par(op)
# }

Run the code above in your browser using DataLab