krige.conv {geoR} | R Documentation |
Spatial Prediction – Conventional Kriging
Description
This function performs spatial prediction for fixed covariance parameters using global neighbourhood.
Options available implement the following types of kriging: 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, 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 |
an |
data |
a vector with n data values. By default it takes the
component |
locations |
an |
borders |
optional. By default reads the element |
krige |
a list defining the model components and the type of
kriging. It can take an output to a call to |
output |
a list specifying output options.
It can take an output to a call to |
type.krige |
type of kriging to be performed. Options are
|
trend.d |
specifies the trend (covariate) values at the data
locations.
See documentation of |
trend.l |
specifies the trend (covariate) values at prediction
locations. It must be of the same type as for |
obj.model |
a list with the model parameters. Typically an
output of |
beta |
numerical value of the mean (vector) parameter.
Only used if |
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.pars |
a 2 elements vector with values of the covariance parameters |
kappa |
additional smoothness parameter required by the following correlation
functions: |
nugget |
the value of the nugget variance parameter |
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 precision of the predictions.
Often in practice, these two variance components are indistinguishable but the
distinction can be made here if justifiable. See the section
|
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 |
lambda |
numeric value of the Box-Cox transformation parameter.
The value |
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.
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:
predict |
a vector with predicted values. |
krige.var |
a vector with predicted variances. |
beta.est |
estimates of the |
simulations |
an |
message |
messages about the type of prediction performed. |
call |
the function call. |
Other results can be included depending on the options passed to
output.control
.
Author(s)
Paulo J. Ribeiro Jr. paulojus@leg.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.
References
Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR/.
See Also
output.control
sets output options,
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
## Not run:
# Defining a prediction grid
loci <- expand.grid(seq(0,1,l=21), seq(0,1,l=21))
# predicting by ordinary kriging
kc <- krige.conv(s100, loc=loci,
krige=krige.control(cov.pars=c(1, .25)))
# mapping point estimates and variances
par.ori <- par(no.readonly = TRUE)
par(mfrow=c(1,2), mar=c(3.5,3.5,1,0), mgp=c(1.5,.5,0))
image(kc, main="kriging estimates")
image(kc, val=sqrt(kc$krige.var), main="kriging std. errors")
# Now setting the output to simulate from the predictive
# (obtaining conditional simulations),
# and to compute quantile and probability estimators
s.out <- output.control(n.predictive = 1000, quant=0.9, thres=2)
set.seed(123)
kc <- krige.conv(s100, loc = loci,
krige = krige.control(cov.pars = c(1,.25)),
output = s.out)
par(mfrow=c(2,2))
image(kc, val=kc$simul[,1], main="a cond. simul.")
image(kc, val=kc$simul[,1], main="another cond. simul.")
image(kc, val=(1 - kc$prob), main="Map of P(Y > 2)")
image(kc, val=kc$quant, main="Map of y s.t. P(Y < y) = 0.9")
par(par.ori)
## End(Not run)