RandomFields (version 2.0.71)

Kriging: Kriging methods

Description

The function allows for different methods of kriging.

Usage

Kriging(krige.method, x, y=NULL, z=NULL, T=NULL, grid,
        gridtriple=FALSE, model, param, given, data, trend=NULL, pch=".",
        return.variance=FALSE, allowdistanceZero = FALSE, cholesky=FALSE)

Arguments

krige.method
kriging method; currently only 'S' (simple kriging), 'O' (ordinary kriging), 'U' (universal kriging) and 'I' (intrinsic kriging) implemented.
x
$(n \times d)$ matrix or vector of x coordinates; coordinates of $n$ points to be kriged
y
vector of y coordinates.
z
vector of z coordinates.
T
vector in grid triple form for the time coordinates.
grid
logical; determines whether the vectors x, y, and z should be interpreted as a grid definition, see Details.
gridtriple
logical. Only relevant if grid=TRUE. If gridtriple=TRUE then x, y, and z are of the form c(start,end,step); if gridtriple=FALSE then x
model
string; covariance model, see CovarianceFct, or type PrintModelList() to get all options.
param
parameter vector: param=c(mean, variance, nugget, scale,...); the parameters must be given in this order. Further parameters are to be added in case of a parametrised class of covariance functions, see
given
matrix or vector of points where data are available.
data
the data values given at given; it might be a vector or a matrix. If a matrix is given multivariate data are assumed which are kriged separately.
trend
only used for universal and intrinsic kriging. In case of universal kriging trend is a non-negative integer (monomials up to order k as trend functions), a list of functions or a formula (the summands are the trend functions); you have
pch
Kriging procedures are quite time consuming in general. The character pch is printed after roughly each 80th part of calculation.
return.variance
logical. If FALSE the kriged field is returned. If TRUE a list of two elements, estim and var, i.e. the kriged field and the kriging variances, is returned.
allowdistanceZero
if TRUE then identical locations are slightly scattered
cholesky
if TRUE cholesky decomposition is used instead of LU.

Value

  • If variance.return=FALSE Kriging returns a vector or matrix of kriged values corresponding to the specification of x, y, z, and grid, and data. data: a vector or matrix with one column * grid=FALSE. A vector of simulated values is returned (independent of the dimension of the random field) * grid=TRUE. An array of the dimension of the random field is returned (according to the specification of x, y, and z). data: a matrix with at least two columns * grid=FALSE. A matrix with the ncol(data) columns is returned. * grid=TRUE. An array of dimension $d+1$, where $d$ is the dimension of the random field, is returned (according to the specification of x, y, and z). The last dimension contains the realisations.

    If variance.return=TRUE a list of two elements, estim and var, i.e. the kriged field and the kriging variances, is returned. The format of estim is the same as described above. The format of var is accordingly.

Details

  • grid=FALSE: the vectorsx,y, andzare interpreted as vectors of coordinates
  • (grid=TRUE) && (gridtriple=FALSE): the vectorsx,y, andzare increasing sequences with identical lags for each sequence. A corresponding grid is created (as given byexpand.grid).
  • (grid=TRUE) && (gridtriple=TRUE): the vectorsx,y, andzare triples of the form (start,end,step) defining a grid (as given byexpand.grid(seq(x$start,x$end,x$step), seq(y$start,y$end,y$step), seq(z$start,z$end,z$step)))

References

Chiles, J.-P. and Delfiner, P. (1999) Geostatistics. Modeling Spatial Uncertainty. New York: Wiley.

Cressie, N.A.C. (1993) Statistics for Spatial Data. New York: Wiley. Goovaerts, P. (1997) Geostatistics for Natural Resources Evaluation. New York: Oxford University Press. Wackernagel, H. (1998) Multivariate Geostatistics. Berlin: Springer, 2nd edition.

See Also

CondSimu, Covariance, CovarianceFct, EmpiricalVariogram, RandomFields,

Examples

Run this code
###Example 1: Ordinary Kriging
## creating random variables first
## here, a grid is chosen, but does not matter
step <- 0.25 
x <-  seq(0,7,step)
param <- c(0,1,0,1)
model <- "exponential"
RFparameters(PracticalRange=FALSE)
p <- 1:7
points <- as.matrix(expand.grid(p,p))
data <- GaussRF(points, grid=FALSE, model=model, param=param)

## visualise generated spatial data
zlim <- c(-2.6,2.6)
colour <- rainbow(100)
image(p, p, xlim=range(x), ylim=range(x),
      matrix(data,ncol=length(p)),
      col=colour,zlim=zlim)

## now: kriging
krige.method <- "O" ## ordinary kriging
z <-  Kriging(krige.method=krige.method,
              x=x, y=x, grid=TRUE,
              model=model, param=param,
              given=points, data=data)
image(x,x,z,col=colour,zlim=zlim)

Run the code above in your browser using DataLab