Learn R Programming

geoR (version 1.2-5)

krige.conv: Spatial Prediction -- Conventional Kriging

Description

This function performs spatial prediction for fixed covariance parameters using global neighbourhood. Available options implement the following kriging types: SK (simple kriging), OK (ordinary kriging), KTE (external trend kriging) and UK (universal kriging).

Usage

krige.conv(geodata, coords=geodata$coords, data=geodata$data,
            locations, borders = NULL, krige, output)

krige.control(type.krige = "ok", trend.d = "cte", trend.l = "cte", obj.model = NULL, beta, cov.model, cov.pars, kappa, nugget, micro.scale = 0, dist.epsilon = 1e-10, aniso.pars, lambda)

Arguments

geodata
a list containing elements coords and data as described next. Typically an object of the class "geodata" - a geoR data-set. If not provided the arguments
coords
an $n \times 2$ matrix or data-frame with the 2-D coordinates of the $n$ data locations. By default it takes the component coords of the argument geodata, if provided.
data
a vector with n data values. By default it takes the component data of the argument geodata, if provided.
locations
an $N \times 2$ matrix or data-frame with the 2-D coordinates of the $N$ prediction locations.
borders
optional. If a two column matrix defining a polygon is provided the prediction is performed only at locations inside this polygon.
krige
a list defining the model components and the type of kriging. It can take an output to a call to krige.control or a list with elements as for the arguments in krige.control. Default values are assumed for arguments o
output
a list specifying output options. It can take an output to a call to output.control or a list with elements as for the arguments in output.control. Default values are assumed for arguments not provided. See docume
type.krige
type of kriging to be performed. Options are "SK", "OK" corresponding to simple or ordinary kriging. Kriging with external trend and universal kriging can be defined setting type.krige = "OK" and specifying the tr
trend.d
specifies the trend (covariate) values at the data locations. See documentation of trend.spatial for further details. Defaults to "cte".
trend.l
specifies the trend (covariate) values at prediction locations. It must be of the same type as for trend.d. Only used if prediction locations are provided in the argument locations.
obj.model
a list with the model parameters. Typically an output of likfit or variofit.
beta
numerical value of the mean (vector) parameter. Only used if type.krige="SK".
cov.model
string indicating the name of the model for the correlation function. Further details can be found in the documentation of the function cov.spatial.
cov.pars
a vector with 2 elements or an $n \times 2$ matrix with the covariance parameters $\sigma^2$ (partial sill) and $\phi$ (range parameter). If a vector, the elements are the values of $\sigma^2$ and $\phi$, respectively. If a matrix, correspond
kappa
additional smoothness parameter required by the following correlation functions: "matern", "powered.exponential", "cauchy" and "gneiting.matern".
nugget
the value of the nugget variance parameter $\tau^2$. Defaults to zero.
micro.scale
micro-scale variance. If different from zero, the nugget variance is divided into 2 terms: micro-scale variance and measurement error. This affect the estimated precision of the predictions. Often in practice, these two
dist.epsilon
a numeric value. Locations which are separated by a distance less than this value are considered co-located.
aniso.pars
parameters for geometric anisotropy correction. If aniso.pars = FALSE no correction is made, otherwise a two elements vector with values for the anisotropy parameters must be provided. Anisotropy correction consists of a trans
lambda
numeric value of the Box-Cox transformation parameter. The value $\lambda = 1$ corresponds to no transformation and $\lambda = 0$ corresponds to the log-transformation. Prediction results are back-transformed and returned is the same

Value

  • An object of the class kriging. The attribute prediction.locations containing the name of the object with the coordinates of the prediction locations (argument locations) is assigned to the object. Returns a list with the following components:
  • predicta vector with predicted values.
  • krige.vara vector with predicted variances.
  • beta.estestimates of the $\beta$, parameter implicit in kriging procedure. Not included if type.krige = "SK".
  • simulationsan $ni \times n.sim$ matrix where $ni$ is the number of prediction locations. Each column corresponds to a conditional simulation of the predictive distribution. Only returned if n.sim > 0.
  • messagemessages about the type of prediction performed.
  • callthe function call.

Details

According to the arguments provided, one of the following different types of kriging: SK, OK, UK or KTE is performed. Defaults correspond to ordinary kriging.

References

Further information about geoR can be found at: http://www.maths.lancs.ac.uk/~ribeiro/geoR.

See Also

image.kriging and persp.kriging for graphical output of the results, krige.bayes for Bayesian prediction and ksline for a different implementation of kriging allowing for moving neighborhood. For model fitting see likfit or variofit

Examples

Run this code
if(is.R()) data(s100) 
loci <- expand.grid(seq(0,1,l=31), seq(0,1,l=31))
kc <- krige.conv(s100, loc=loci,
                 krige=krige.control(cov.pars=c(1, .25)))
par(mfrow=c(1,2))
image(kc, main="kriging estimates")
image(kc, val=sqrt(kc$krige.var), main="kriging std. errors")
<testonly>loci <- expand.grid(seq(0,1,l=6), seq(0,1,l=6))
kc <- krige.conv(s100, loc=loci,
                 krige=list(cov.pars=c(1, .25), kappa = 1))</testonly>

Run the code above in your browser using DataLab