Learn R Programming

GSIF (version 0.5-5.1)

test.gstatModel-methods: 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 SpatialPointsDataFrame,formula,SpatialPixelsDataFrame
test.gstatModel(observations, formulaString, covariates, Ns, 
    predictionLocations, save.predictions = TRUE, debug.level = 0, nfold = 5, …)
# S4 method for 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

See Also

fit.gstatModel, gstatModel-class

Examples

Run this code
# NOT RUN {
# 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]]
# }

Run the code above in your browser using DataLab