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

RMangle

Anisotropy matrix given by angle


Description

RMangle delivers an anisotropy matrix for the argument Aniso in RMmodel in two dimensions. RMangle requires one or two stretching values, passed by ratio or diag, and an angle.

In two dimensions and with angle equal to a and diag equal to (d1, d2) the anisotropy matrix A is

A = diag(d1, d2) %*% matrix(ncol=2, c(cos(a), sin(a), -sin(a), cos(a)))

In three dimensions and with angle equal to a, second angle L and diag equal to (d1, d2, d3) the anisotropy matrix A is

A = diag(d1, d2, d3) %*% matrix(ncol=3, c(cos(a) * cos(L), sin(a) * cos(L), sin(L), -sin(a), cos(a), 0, -cos(a) * sin(L), -sin(a) * sin(L), cos(L) )) i.e. Ax turns a vector x first in the x-z plane, then in the x-y plane.

Usage

RMangle(angle, lat.angle, ratio, diag)

Arguments

angle

angle a

lat.angle

second angle; in 3 dimensions only

ratio

equivalent to diag=c(1, 1/ratio); in 2 dimensions only

diag

the diagonal components of the matrix

Value

RMangle 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

model <- RMexp(Aniso=RMangle(angle=pi/4, ratio=3))
plot(model, dim=2)

x <- seq(0, 2, 0.05)
z <- RFsimulate(x, x, model=model)
plot(z)


model <- RMexp(Aniso=RMangle(angle=pi/4, lat.angle=pi/8, diag=c(1,2,3)))
x <- seq(0, 2, 0.2)
z <- RFsimulate(x, x, x, model=model)
plot(z, MARGIN.slices=3)


## next model gives an example how to estimate the parameters back
n <- 20
x <- runif(n, 0, 10)
y <- runif(n, 0, 10)
coords <- expand.grid(x, y)
model <- RMexp(Aniso=RMangle(angle=pi/4, diag=c(1/4, 1/12)))
d <- RFsimulate(model, x=coords[, 1], y=coords[, 2], n=10)
estmodel <- RMexp(Aniso=RMangle(angle=NA, diag=c(NA, NA)))
system.time(RFfit(estmodel, data=d, modus_operandi='sloppy'))

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.