Krig.simple.sparse {KriSp} | R Documentation |
Calculating the BLUP or kriging estimate for large two dimensional spatial datasets.
Krig.simple.sparse(x,Y, cov.fun = "expo.cov", cov.fun.args = list(range = 10, eps = eps), taper.fun = "spher.cov", taper.fun.args = list(range = 10), ncov = 10000, approxhmax = taper.fun.args$range, miles = TRUE, R = NULL, eps = 1e-5, save.sigma = TRUE, save.chol = FALSE, verbose = FALSE, nnzmax = 1e+05, tmpmax = 10000, ...)
x |
a m times 2 matrix containing the locations. |
Y |
the observed values at x . |
cov.fun |
Covariance function in the form of an R function, or its name as a string. |
cov.fun.args |
A list with the arguments to call the covariance function (in addition to the locations). |
taper.fun |
Taper function in the form of an R function, or its name as a string. |
taper.fun.args |
A list with the arguments to call the taper function (in addition to the locations). |
ncov |
Number of knots to evaluate the approximation |
approxhmax |
Maximum distance over which the covariance is approximated |
miles |
logical. If TRUE (default) distances are in statute
miles if FALSE distances in kilometers. |
R |
the radius to use for the sphere to find spherical
distances. If NULL the radius is either in miles or kilometers
of the earth depending on the values of the miles argument. If
R=1 then distances are in radians. |
eps |
small value, everything smaller is considered zero. |
save.sigma |
should the covariance matrix be saved (in
SparseM format). |
save.chol |
should the Cholesky factor of the covariance matrix be
saved (in SparseM format). |
verbose |
should timing and convergence results be printed. |
nnzmax |
upper bound of non-zero elements in the covariance matrix. |
tmpmax |
working array for the Cholesky factorisation |
... |
supplementary parameters that can be given as arguments to
the function chol . |
For computational reasons, we do not call simple the solve
function but use chol(...)
and backsolve(...)
form the
SparseM
library.
We do not allow missing values.
We only consider two-dimensional domains.
Krig.simple.sparse
returns an object of class
c("sparse","Krig")
. The second is to reuse many
handy functions of the library fields
.
An object of the class "sparse"
is a list containing at
least the following components:
call |
the matched call. |
fitted |
fitted values at observed values. |
solve |
vector used for prediction on other grid points. |
sigma |
if requested, the covariance matrix. |
sigmachol |
if requested, the Cholesky factor. |
timing |
time needed for the main calculations. |
nnz |
The number of nonzero elements in the covariance matrix and its Cholesky factor. |
Additionally, most input arguments are passed to the object.
For REALLY big datasets, it would be wise to dissect the functions.
The radius of the earth is assumed to be 3963.34 miles or 6378.388 kilometers.
approxhmax
should be at least as big as the taper range or
the domain of the field.
If nnzmax
is too small, R may produce a `core dumped'.
Krig.simple.sparse
,
predict.sparse
, plot.sparse
;
chol
and backsolve
from the SparseM
library.
data(simple) attach(simple.data) obj <- Krig.simple.sparse( x, Y) pre <- predict( obj, x=cbind(-104.5,40.5)) surf <- predict.surface( obj) image.plot( surf)