test.gstatModel-methods {GSIF} | R Documentation |
Tests predictability of a regression-kriging model on a sample data set. Automates model fitting, cross-validation and prediction and prints out: (1) RMSE at validation points under different sampling intensities, (2) number of predictions per second and (3) number of prediction failures (failure = predictions where cross-validation z-scores exceed value of +/- 1.5 or cross-validation residuals exceed three standard deviations of the observed values).
## S4 method for signature ## 'SpatialPointsDataFrame,formula,SpatialPixelsDataFrame' test.gstatModel(observations, formulaString, covariates, Ns, predictionLocations, save.predictions = TRUE, debug.level = 0, nfold = 5, ...) ## S4 method for signature 'geosamples,formula,SpatialPixelsDataFrame' test.gstatModel(observations, formulaString, covariates, Ns, predictionLocations, save.predictions = TRUE, debug.level = 0, nfold = 5, ...)
observations |
object of type |
formulaString |
object of type |
covariates |
object of type |
Ns |
vector; list of sampling intensities (maximum should not exceed the total number of samples) |
predictionLocations |
object of class |
save.predictions |
logical; indicates whether the prediction results should also be saved |
debug.level |
integer; gstat's setting to hide the progress output |
nfold |
integer; number of folds for cross-validation |
... |
other optional arguments that can be passed to |
Vector of sampling intensities, if not provided, will be estimated as: sequence of 10 numbers on square root scale (where N minimum is determined as 20 + number of covariates times 10 and N maximum is the total number of observations). Where no model can be fitted, function returns an empty set. This function can be time consuming for large data sets and is hence recommended only for testing a mapping algorithm using sample data.
Tomislav Hengl, Gerard B.M. Heuvelink
fit.gstatModel
, gstatModel-class
# 2D model: library(sp) library(maptools) ## load the Meuse data set: demo(meuse, echo=FALSE) ## model diagnostics: t1 <- test.gstatModel(meuse, om~dist+ffreq, meuse.grid, fit.family = gaussian(log), Ns=c(80, 155)) t1[[1]]