krige.cv(formula, locations, data, model = NULL, beta = NULL, nmax = Inf,
nmin = 0, maxdist = Inf, nfold = nrow(data), verbose = TRUE, ...)z, for ordinary and simple kriging use the formula z~1;
for simple kriging also define be~x+y; if data
is of class spatial.data.frame, this argument may be ignored, as
it can be derived from the datamaxdist is less than nmin, a missing
value will be generated; see maxdistmaxdist from the prediction location are used for prediction
or simulation; if combined with nmax, both criteria applynfold is set
to nrow(data) (the default), leave-one-out cross validation is
done; if set to e.g. 5, five-fold cross validation is donenewdata, and
columns of prediction and prediction variance of cross validated data
points, observed values, residuals, zscore (residual divided by kriging
standard error), and fold.data(meuse)
m <- vgm(.59, "Sph", 874, .04)
# five-fold cross validation:
x <- krige.cv(log(zinc)~1, ~x+y, model = m, data = meuse, nmax = 40, nfold=5)
bubble(x, z = "residual", main = "log(zinc): 5-fold CV residuals")Run the code above in your browser using DataLab