RMbubble: Bubble model for arbitrary areas of scales

Description Usage Arguments Details Value Note References See Also Examples

View source: R/RMmodels.R

Description

A model that allows for arbitray areas of scale applied to an isotropic model, i.e.

C(x,y) = φ(\|x -y \| / s)

as long as s_x = s_y = s. Here, s_x is the scaling at location x,

The cross-correlations between areas of different scales are given through a modified distance d. Let z_{s} be a finite subset of R^d depending on the scale s. Let w_u be a weight for an auxiliary point u\in z_{s} with ∑_{u \in z_s} w_u = 1. Let τ_x = s_x^{-2}. Then

d^2(x, y) = \min\{τ(x), τ(y)\} \|x - y\|^2 + ∑_{ξ \in_{span(τ(x), τ(y))}} ∑_{u \in z_{ξ^{-0.5}}} w_u \|x - u\|^2 Δ ξ

Here, span(τ(x), τ(y)) is the finite set of values s^{-2} that are realized on the locations of interest and Δ ξ is the difference of two realized and ordered values of the scaling s.

Usage

1
2
RMbubble(phi, scaling, z, weight, minscale, barycentre,
         var, scale, Aniso, proj)

Arguments

phi

isotropic submodel

scaling

model that gives the non-stationary scaling s_x

z

matrix of the union of all z_s. The number of rows equals the dimension of the field. If not given, the locations with non-vanishing gradient are taken.

weight

vector of weights w whose length equals the number of columns of z. The points given by z might be weighted.

minscale

vector for partioning z into classes z_s. Its length equals the number of columns of z. The vector values must be descending. See details. If not given then z_s=z for all s. Else see details.

barycentre

logical. If FALSE and z is not given, the reference locations are those with non-vashing gradient. If TRUE then, for each realized value of the scale, the barycentre of the corresponding reference locations is used instead of the reference locations themselves. This leads to higher correlations, but also to highly non-stationary cross-correlation between the areas of different scale.

The argument has no effect when z is given.

Default: FALSE.

var,scale,Aniso,proj

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

Details

minscale gives the minimal scale s value above which the corresponding points z define the set z_s. The validity of the set z_s ends with the next lower value given.

Let minscale = (10, 10, 10, 7, 7, 7, 0.5). Then for some d-dimensional vectors z_1,…, z_7 we have

z_s = \{ z_1, z_2, z_3 \}, s ≥ 10

z_s = \{ z_4, z_5, z_5 \}, 7 ≥ s < 10

z_s = \{ z_7 \}, s ≥ 0.5

Note that, in this case, all realized scaling values must be ≥ 0.5. Note further, that the weights for the subset must sum up to one, i.e.

w_1+w_2 +w_3=w_4 + w_5 + w_6 = w_7 = 1.

Value

RMbubble returns an object of class RMmodel.

Note

This model is defined only for grids.

References

See Also

RMSadvanced, RMblend, RMscale

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again

x <- seq(0,1, if (interactive()) 0.02 else 0.5)
d <- sqrt(rowSums(as.matrix(expand.grid(x-0.5, x-0.5))^2))
d <- matrix(d < 0.25, nc=length(x))
image(d)

scale <- RMcovariate(data=as.double(d) * 2 + 0.5, raw=TRUE)

## two models:
## the frist uses the standard approach for determining the
##           reference point z, which is based on gradients
## the second takes the centre of the ball
model1 <- RMbubble(RMexp(), scaling=scale)
model2 <- RMbubble(RMexp(), scaling=scale, z=c(0.5, 0.5))
model3 <- RMbubble(RMexp(), scaling=scale, barycentre=TRUE) # approx. of model2

## model2 has slightly higher correlations than model1:
C1 <- RFcovmatrix(model1, x, x)
C2 <- RFcovmatrix(model2, x, x)
C3 <- RFcovmatrix(model3, x, x) 
print(range(C2 - C1))
dev.new(); hist(C2 - C1)
print(range(C3 - C2)) # only small differences to C2
print(mean(C3 - C2))
dev.new(); hist(C3 - C2)

plot(z1 <- RFsimulate(model1, x, x))
plot(z2 <- RFsimulate(model2, x, x))
plot(z3 <- RFsimulate(model3, x, x)) # only tiny differences to z2


## in the following we compare the standard bubble model with
## the models RMblend, RMscale and RMS (so, model2 above
## performs even better)
biwm <- RMbiwm(nudiag=c(0.5, 0.5), nured=1, rhored=1, cdiag=c(1, 1), 
                s=c(0.5, 2.5, 0.5))
blend <- RMblend(multi=biwm, blend=RMcovariate(data = as.double(d), raw=TRUE))
plot(zblend <- RFsimulate(blend, x, x)) ## takes a while ...
Cblend <- RFcovmatrix(blend, x, x)

Mscale <- RMscale(RMexp(), scaling = scale, penalty=RMid() / 2)
plot(zscale <- RFsimulate(Mscale, x, x))
Cscale <- RFcovmatrix(Mscale, x, x)

Mscale2 <- RMscale(RMexp(), scaling = scale, penalty=RMid() / 20000)
plot(zscale2 <- RFsimulate(Mscale2, x, x))
Cscale2 <- RFcovmatrix(Mscale2, x, x)

S <- RMexp(scale = scale)
plot(zS <- RFsimulate(S, x, x))
CS <- RFcovmatrix(S, x, x)

print(range(C1 - CS))
print(range(C1 - Cscale))
print(range(C1 - Cscale2))
print(range(C1 - Cblend))
dev.new(); hist(C1-CS)     ## C1 is better
dev.new(); hist(C1-Cscale) ## C1 is better
dev.new(); hist(C1-Cscale2) ## both are equally good. Maybe C1 slightly better
dev.new(); hist(C1-Cblend) ## C1 is better

RandomFields documentation built on Jan. 19, 2022, 1:06 a.m.