Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RMcov

Non-stationary covariance model corresponding to a variogram model


Description

This function generalizes the well-known non-stationary covariance function 2\min\{x,y\} of the Brownian motion with variogram γ(x,y) = |x-y|, x,y≥ 0 to arbitrary variogram models any spatial processes of any dimension and multivariability.

Furthermore, the standard condition for the Brownian motion W is that variance equals 0 at the origin, i.e., W(x) =^d Z(x) -Z(0) for any zero mean Gaussian process Z with variogram γ(x,y) = |x-y| is replaced by W(x) = Z(x) -∑_{i=1}^n a_i Z(x_i) with ∑_{i=1}^n a_i = 1.

For a given variogram γ, a_i and x_i, the model equals C(x, y) = ∑_{i=1}^n a_i (γ(x, x_i) + γ(x_i, y)) - γ(x, y) - ∑_{i=1}^n ∑_{j=1}^n a_i a_j γ(x_i, y_i)

Usage

RMcov(gamma, x, y=NULL, z=NULL, T=NULL, grid, a,
       var, scale, Aniso, proj, raw, norm)

Arguments

gamma

a variogram model. Possibly multivariate.

x,y,z,T,grid

The usual arguments as in RFsimulate to define the locations where the covariates are given. Additional x might be set to one of the values "origin", "center", "extremals", or "all". If x is not given, x is set to "origin".

a

vector of weights. The length of a must equal the number of points given by x, y, z and T. The values of a must sum up to 1. If a is not given, equals weights are used.

var,scale,Aniso,proj

optional arguments; same meaning for any RMmodel. If not passed, the above covariance function remains unmodified.

raw

logical. If FALSE then the data are interpolated. This approach is always save, but might be slow. If TRUE then the data may be accessed when covariance matrices are calculated. No rescaling or anisotropy definition is allowed in combination with the model. The use is dangerous, but fast.
Default: FALSE.

norm

optional model that gives the norm between locations

Value

RMcov returns an object of class RMmodel

Author(s)

See Also

Examples

RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again
bm <- RMfbm(alpha=1)
plot(bm)

x <- seq(0, 6, if (interactive()) 0.125 else 3)
plot(RFsimulate(bm, x))

## standardizing with the random variable at the origin
z1 <- RFsimulate(RMcov(bm), x)
plot(z1)
z1 <- as.vector(z1)
zero <- which(abs(x) == 0)
stopifnot(abs(z1[zero]) < 1e-13)

## standardizing with the random variable at the center of the interval
z2 <- RFsimulate(RMcov(bm, "center"), x)
plot(z2)
z2 <- as.vector(z2)
stopifnot(abs(z2[(length(z2) + 1) / 2]) < 1e-13)


## standardizing with the random variables at the end points of the interval
z3 <- RFsimulate(RMcov(bm, "extremals"), x)
plot(z3)
z3 <- as.vector(z3)
stopifnot(abs(z3[1] + z3[length(z3)]) < 1e-13)

RandomFields

Simulation and Analysis of Random Fields

v3.3.10
GPL (>= 3)
Authors
Martin Schlather [aut, cre], Alexander Malinowski [aut], Marco Oesting [aut], Daphne Boecker [aut], Kirstin Strokorb [aut], Sebastian Engelke [aut], Johannes Martini [aut], Felix Ballani [aut], Olga Moreva [aut], Jonas Auel[ctr], Peter Menck [ctr], Sebastian Gross [ctr], Ulrike Ober [ctb], Paulo Ribeiro [ctb], Brian D. Ripley [ctb], Richard Singleton [ctb], Ben Pfaff [ctb], R Core Team [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.