kriging: kriging

View source: R/kriging.R

krigingR Documentation

kriging

Description

Ordinary kriging interpolation of spatial data. Implements a simple version of ordinary kriging that uses all the data in a training set to predict the z-value of some test data, using a semivariogram model generated by the semivariogram function.

Usage

kriging(x, y, z, xi, yi, svm, grid = FALSE, err = FALSE)

Arguments

x

numerical vector of training data

y

numerical vector of the same length as x

z

numerical vector of the same length as x

xi

scalar or vector with the x-coordinates of the points at which the z-values are to be evaluated.

yi

scalar or vector with the y-coordinates of the points at which the z-values are to be evaluated.

svm

output of the semivariogram function, a 3-element vector with the sill, nugget and range of the semivariogram fit.

grid

logical. If TRUE, evaluates the kriging interpolator along a regular grid of values defined by xi and yi.

err

logical. If TRUE, returns the variance of the kriging estimate.

Value

either a vector (if grid=FALSE) or a matrix (if grid=TRUE) of kriging interpolations. In the latter case, values that are more than 10% out of the data range are given NA values.

Examples

data(meuse,package='geostats')
x <- meuse$x
y <- meuse$y
z <- log(meuse$cadmium)
svm <- semivariogram(x=x,y=y,z=z)
kriging(x=x,y=y,z=z,xi=179850,yi=331650,svm=svm,grid=TRUE)

geostats documentation built on Jan. 7, 2023, 5:32 p.m.

Related to kriging in geostats...