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

RFmadogram

Empirical (Cross-)Madogram


Description

Calculates the empirical (cross-)madogram. The empirical (cross-)madogram of two random fields X and Y is given by

γ(r):=1/N(r) ∑_{(t_{i},t_{j})|t_{i,j}=r} |(X(t_{i})-X(t_{j}))||(Y(t_{i})-Y(t_{j}))|

where t_{i,j}:=t_{i}-t_{j}, and where N(r) denotes the number of pairs of data points with distancevector t_{i,j}=r.

Usage

RFmadogram(model, x, y=NULL, z=NULL, T=NULL, grid, params, distances,
           dim, ..., data, bin=NULL, phi=NULL, theta = NULL,
           deltaT = NULL, vdim=NULL)

Arguments

model,params

object of class RMmodel, RFformula or formula; best is to consider the examples below, first.
The argument params is a list that specifies free parameters in a formula description, see RMformula.

x

vector of x coordinates, or object of class GridTopology or raster; for more options see RFsimulateAdvanced.

y,z

optional vectors of y (z) coordinates, which should not be given if x is a matrix.

T

optional vector of time coordinates, T must always be an equidistant vector. Instead of T=seq(from=From, by=By, len=Len), one may also write T=c(From, By, Len).

grid

logical; the function finds itself the correct value in nearly all cases, so that usually grid need not be given. See also RFsimulateAdvanced.

distances,dim

another alternative for the argument x to pass the (relative) coordinates, see RFsimulateAdvanced.

...

for advanced use: further options and control arguments for the simulation that are passed to and processed by RFoptions. If params is given, then ... may include also the variables used in params.

data

matrix, data.frame or object of class RFsp;
If a matrix is given the ordering of the colums is the following: space, time, multivariate, repetitions, i.e. the index for the space runs the fastest and that for repetitions the slowest.

bin

a vector giving the borders of the bins; If not specified an array describing the empirical (pseudo-)(cross-) covariance function in every direction is returned.

phi

an integer defining the number of sectors one half of the X/Y plane shall be divided into. If not specified, either an array is returned (if bin missing) or isotropy is assumed (if bin specified).

theta

an integer defining the number of sectors one half of the X/Z plane shall be divided into. Use only for dimension d=3 if phi is already specified.

deltaT

vector of length 2, specifying the temporal bins. The internal bin vector becomes seq(from=0, to=deltaT[1], by=deltaT[2])

vdim

the number of variables of a multivariate data set. If not given and data is an RFsp object created by RandomFields, the information there is taken from there. Otherwise vdim is assumed to be one. NOTE: still the argument vdim is an experimental stage.

Details

RFmadogram computes the empirical cross-madogram for given (multivariate) spatial data.

The spatial coordinates x, y, z should be vectors. For random fields of spatial dimension d > 3 write all vectors as columns of matrix x. In this case do neither use y, nor z and write the columns in gridtriple notation.

If the data is spatially located on a grid a fast algorithm based on the fast Fourier transformed (fft) will be used. As advanced option the calculation method can also be changed for grid data (see RFoptions.)

It is also possible to use RFmadogram to calculate the pseudomadogram (see RFoptions).

Value

RFmadogram returns objects of class RFempVariog.

Author(s)

Jonas Auel; Sebastian Engelke; Johannes Martini; Martin Schlather, schlather@math.uni-mannheim.de, https://www.wim.uni-mannheim.de/schlather/

References

Gelfand, A. E., Diggle, P., Fuentes, M. and Guttorp, P. (eds.) (2010) Handbook of Spatial Statistics. Boca Raton: Chapman & Hall/CRL.

Stein, M. L. (1999) Interpolation of Spatial Data. New York: Springer-Verlag

See Also

Examples

RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again

n <- 1 ## use n <- 2 for better results

## isotropic model
model <- RMexp()
x <- seq(0, 10, 0.02)
z <- RFsimulate(model, x=x, n=n)
emp.vario <- RFmadogram(data=z)
plot(emp.vario)


## anisotropic model
model <- RMexp(Aniso=cbind(c(2,1), c(1,1)))
x <- seq(0, 10, 0.05)
z <- RFsimulate(model, x=x, y=x, n=n)
emp.vario <- RFmadogram(data=z, phi=4)
plot(emp.vario)


## space-time model
model <- RMnsst(phi=RMexp(), psi=RMfbm(alpha=1), delta=2)
x <- seq(0, 10, 0.05)
T <- c(0, 0.1, 100)
z <- RFsimulate(x=x, T=T, model=model, n=n)
emp.vario <- RFmadogram(data=z, deltaT=c(10, 1))
plot(emp.vario, nmax.T=3)


## multivariate model
model <- RMbiwm(nudiag=c(1, 2), nured=1, rhored=1, cdiag=c(1, 5), 
                s=c(1, 1, 2))
x <- seq(0, 20, 0.1)
z <- RFsimulate(model, x=x, y=x, n=n)
emp.vario <- RFmadogram(data=z)
plot(emp.vario)


## multivariate and anisotropic model
model <- RMbiwm(A=matrix(c(1,1,1,2), nc=2),
                nudiag=c(0.5,2), s=c(3, 1, 2), c=c(1, 0, 1))
x <- seq(0, 20, 0.1)
dta <- RFsimulate(model, x, x, n=n)
ev <- RFmadogram(data=dta, phi=4)
plot(ev, boundaries=FALSE)

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.