| krige.conv {geoR} | R Documentation |
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).
krige.conv(geodata, coords = geodata$coords, data = geodata$data,
locations,
krige = krige.control(type.krige, beta = NULL,
trend.d, trend.l, cov.model, cov.pars,
kappa = 0.5, nugget = 0, micro.scale = 0,
dist.epsilon = 1e-10, aniso.pars = NULL,
lambda = 1, signal = FALSE,
n.samples.backtransform = 500, n.sim = 0),
messages.screen = TRUE)
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 and data must be provided instead. |
coords |
an n x 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 x 2 matrix or data-frame with the 2-D coordinates of the N prediction locations. |
krige |
defines the model components and the type of
kriging. See section DETAILS below.
ATTENTION: the argument cov.pars is obligatory whilst
all the others have default options. |
messages.screen |
logical. Indicates whether or not status messages are printed on the screen (or other output device) while the function is running. |
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.
Arguments for krige = krige.control(...) :
"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
trend model using the arguments trend.d and
trend.l. type.krige="SK"."cte" (constant mean),
"1st" (first order polynomial on the coordinates),
"2nd" - (second order polynomial on the
coordinates). Alternatively
a formula of the type ~X can be provided, where X is
a matrix with covariates (external trend) at data locations.
Defaults to "cte". trend.d.
Only used if prediction locations are provided in the argument
locations. cov.spatial. "matern", "powered.exponential", "cauchy" and
"gneiting.matern". 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
transformation of the data and prediction coordinates performed
by the function coords.aniso. TRUE the signal is predicted, otherwise the
observation is predicted. If no transformation is performed the
expectations are the same in both cases and the difference is only for
values of the kriging variance, when the value of the nugget is
different from zero. lambda), back-transformations
are usually performed by sampling from the predictive distribution and
then back-transforming the sampled values. The exceptions are for
lambda = 0 (log-transformation) and
lambda = 1 (no transformation). n.sim is provided, samples are
taken from the predictive distribution.
An object of the class kriging which is a list
with the following components:
predict |
a vector with predicted values. |
krige.var |
a vector with predicted variances. |
beta.est |
estimates of the beta, parameter
implicit in kriging procedure. Not included if
type.krige = "SK". |
simulations |
an ni x 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. |
message |
messages about the type of prediction performed. |
call |
the function call. |
Paulo J. Ribeiro Jr. Paulo.Ribeiro@est.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.
Further information about geoR can be found at:
http://www.maths.lancs.ac.uk/~ribeiro/geoR.html.
image.kriging for graphical output of the results,
krige.bayes for Bayesian prediction and ksline
for a different implementation of kriging allowing for moving neighborhood.
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.kriging(kc, loc=loci, main="kriging estimates")
image.kriging(kc, loc=loci, val=sqrt(kc$krige.var),
main="kriging std. errors")