test.gstatModel-methods {GSIF}R Documentation

Methods to test predictability of a regression-kriging model

Description

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).

Usage

 
## 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, ...)

Arguments

observations

object of type "SpatialPointsDataFrame" or "geosamples-class"

formulaString

object of type "formula" or a list of formulas

covariates

object of type "SpatialPixelsDataFrame", or list of grids

Ns

vector; list of sampling intensities (maximum should not exceed the total number of samples)

predictionLocations

object of class "SpatialPixelsDataFrame"; if not specified then passes the object covariates

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 fit.gstatModel

Note

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.

Author(s)

Tomislav Hengl, Gerard B.M. Heuvelink

See Also

fit.gstatModel, gstatModel-class

Examples

# 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]]

[Package GSIF version 0.5-5 Index]