RFempiricalvariogram(x, y = NULL, z = NULL, T = NULL, data, grid,
bin, phi, theta, deltaT, distances, vdim, ...)
GridTopology
or
raster
.
If matrix, ncol(x)<
x
is a matrixx
is a matrixT
must always be an equidistant vector or given in a
gridtriple format (see grid
); for each component
of T
, the random field is simulated at all location points;
the argumentx
,
y
, and z
or the columns of x
should be
interpreted as a grid definition (see Details). If grid=TRUE
,
either x
, y
, and seq(from=0, to=deltaT[1], by=deltaT[2])
dist
representing
the upper trianguar part of the matrix of Euclidean distances
between the points at which the field is to be simulated; only
applicable for stationary and isotropic modata
is an RFsp
object
created by vdim
is assumed to be o
The spatial coordinates x
, y
, z
should be vectors. For random fields of
spatial dimension $d > 3$ write all vectors as colums of matrix x. In
this case do neither use y, nor z and write the colums 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
Stein, M. L. (1999) Interpolation of Spatial Data. New York: Springer-Verlag
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, if (interactive()) 0.02 else 1)
z <- RFsimulate(model, x=x, n=n)
emp.vario <- RFempiricalvariogram(data=z)
plot(emp.vario, model=model)
## anisotropic model
model <- RMexp(Aniso=cbind(c(2,1), c(1,1)))
x <- seq(0, 10, if (interactive()) 0.05 else 1)
z <- RFsimulate(model, x=x, y=x, n=n)
emp.vario <- RFempiricalvariogram(data=z, phi=4)
plot(emp.vario, model=model)
## space-time model
model <- RMexp()
x <- seq(0, 10, if (interactive()) 0.05 else 1)
T <- c(0, if (interactive()) 0.1 else 1, if (interactive()) 100 else 10)
z <- RFsimulate(x=x, T=T, model=model, n=n)
emp.vario <- RFempiricalvariogram(data=z, deltaT=c(10, 1))
plot(emp.vario, model=model, 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, if (interactive()) 0.1 else 2)
z <- RFsimulate(model, x=x, y=x, n=n)
emp.vario <- RFempiricalvariogram(data=z)
plot(emp.vario, model=model)
## 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, if (interactive()) 0.1 else 2)
data <- RFsimulate(model, x, x, n=n)
ev <- RFempiricalvariogram(data=data, phi=4)
plot(ev, model=model, boundaries=FALSE)
FinalizeExample()
Run the code above in your browser using DataLab