ksline  R Documentation 
This function performs spatial prediction for given covariance parameters. Options implement the following kriging types: SK (simple kriging), OK (ordinary kriging), KTE (external trend kriging) and UK (universal kriging).
The function krige.conv
should be preferred, unless
moving neighborhood is to be used.
ksline(geodata, coords = geodata$coords, data = geodata$data, locations, borders = NULL, cov.model = "matern", cov.pars=stop("covariance parameters (sigmasq and phi) needed"), kappa = 0.5, nugget = 0, micro.scale = 0, lambda = 1, m0 = "ok", nwin = "full", n.samples.backtransform = 500, trend = 1, d = 2, ktedata = NULL, ktelocations = NULL, aniso.pars = NULL, signal = FALSE, dist.epsilon = 1e10, messages)
geodata 
a list containing elements 
coords 
an n x 2 matrix where each row has the 2D
coordinates of the n data locations.
By default it takes the
component 
data 
a vector with n data values. By default it takes the
component 
locations 
an N x 2 matrix or dataframe with the 2D
coordinates of the N prediction locations, or a list for which
the first two components are used. Input is internally checked by the
function 
borders 
optional. If a two column matrix defining a polygon is provided the prediction is performed only at locations inside this polygon. 
cov.pars 
a vector with 2 elements or an n x 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, corresponding to a model with several structures, the values of sigma^2 are in the first column and the values of phi are in the second. 
nugget 
the value of the nugget variance parameter tau^2. Defaults to zero. 
micro.scale 
microscale variance. If different from zero, the nugget variance is divided into 2 terms: microscale variance and measurement error. This might affect the precision of the predictions. In practice, these two variance components are usually indistinguishable but the distinction can be made here if justifiable. 
cov.model 
string indicating the name of the model for the
correlation function. Further details in the
documentation for

kappa 
additional smoothness parameter required by the following correlation
functions: 
lambda 
numeric value of the BoxCox transformation parameter. The value lambda = 1 corresponds to no transformation and lambda = 0 corresponds to the logtransformation. Prediction results are backtransformed and returned is the same scale as for the original data. 
m0 
The default value 
nwin 
If 
n.samples.backtransform 
number of samples used in the
backtransformation. When transformations are used
(specified by an argument 
trend 
only required if 
d 
spatial dimension, 1 defines a prediction on a line, 2 on a plane (the default). 
ktedata 
only required if 
ktelocations 
only required if 
aniso.pars 
parameters for geometric anisotropy
correction. If 
signal 
logical. If 
dist.epsilon 
a numeric value. Points which are separated by a distance less than this value are considered colocated. 
messages 
logical. Indicates whether or not status messages are printed on the screen (or other output device) while the function is running. 
An object of the class
kriging
which is a list
with the following components:
predict 
the predicted values. 
krige.var 
the kriging variances. 
dif 
the difference between the predicted value and the global mean. Represents the contribution to the neighboring data to the prediction at each point. 
summary 
values of the arithmetic and weighted mean of the data and standard deviations. The weighted mean corresponds to the estimated value of the global mean. 
ktrend 
the matrix with trend if 
ktetrend 
the matrix with trend if 
beta 
the value of the mean which is implicitly estimated for

wofmean 
weight of mean. The predicted value is an weighted average between the global mean and the values at the neighboring locations. The value returned is the weight of the mean. 
locations 
the coordinates of the prediction locations. 
message 
status messages returned by the algorithm. 
call 
the function call. 
This is a preliminary and inefficient function implementing kriging methods.
For predictions using global neighborhood the function
krige.conv
should be used instead.
Paulo J. Ribeiro Jr. paulojus@leg.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.
Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR/.
krige.conv
for a more efficient implementation of
conventional kriging methods,
krige.bayes
for Bayesian prediction.
loci < expand.grid(seq(0,1,l=31), seq(0,1,l=31)) kc < ksline(s100, loc=loci, 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.