Learn R Programming

GSIF (version 0.3-1)

predict.gstatModel-method: Predict from an object of class "gstatModel"

Description

Predicts from an object of class gstatModel-class using new prediction locations. It combines predictions by regression (e.g. GLM) and interpolation of residuals (kriging).

Usage

## S3 method for class 'gstatModel':
predict(object, 
     predictionLocations, nmin = 10, nmax = 30, debug.level = -1, 
     predict.method = c("RK", "KED")[1], nfold = 5, verbose = FALSE, 
     nsim = 0, mask.extra = TRUE, block = predictionLocations@grid@cellsize, 
     zmin = -Inf, zmax = Inf, subsample = length(object@sp), 
     coarsening.factor = 1, vgmmodel = object@vgmModel,
     subset.observations = !is.na(object@sp@coords[,1]), betas = c(0,1), ...)
## S3 method for class 'list':
predict(object, 
     predictionLocations, nmin = 10, nmax = 30, debug.level = -1, 
     predict.method = c("RK", "KED")[1], nfold = 5, verbose = FALSE, 
     nsim = 0, mask.extra = TRUE, block = predictionLocations@grid@cellsize, 
     zmin = -Inf, zmax = Inf, subsample = length(object@sp), ...)

Arguments

object
object of type "gstatModel"
predictionLocations
object of type "SpatialPixelsDataFrame" prediction locations (must contain all covariates from the model)
nmin
integer; minimum number of nearest observations sent to gstat::krige
nmax
integer; maximum number of nearest observations sent to gstat::krige
debug.level
integer; default debug level mode sent to gstat::krige
predict.method
character; mathematical implementation of the gstat::krige interpolation method with covariates: Regression-Kriging (RK) or Kriging with External Drift (KED)
nfold
integer; n-fold cross validation sent to gstat::krige.cv
verbose
logical; specifies whether to supress the progress bar of the gstat::krige.cv
nsim
integer; triggers the geostatistical simulations
mask.extra
logical; specifies whether to mask out the extrapolation pixels (prediction variance exceeding the global variance)
block
numeric; support size (block predictions by default)
zmin
numeric; lower physical limit for the target variable
zmax
numeric; upper physical limit for the target variable
subsample
integer; sub-sample point observations to speed up the processing
coarsening.factor
integer; coarsening factor (1:5) to speed up the processing
vgmmodel
object of class data.frame corresponding to the gstat::vgm variogram
subset.observations
logical; vector specifying the subset of observations used for interpolation
betas
numeric; vector of the beta coefficients to be passed to the gstat::krige
...
other optional arguments that can be passed to gstat::krige and/or predict.glm

Details

Selecting predict.method = "KED" invokes simple kriging with external drift with betas set at 0 (intercept) and 1 (regression predictions i.e. single covariate). This assumes that the regression model already results in an unbiased estimator of the trend model. If not speficied otherwise, subset.observations by default selects only obserations within the spatial domain (bounding box) of the predictionLocations plus 50% of the one third of the extent of the area. Predictions can be speed up by using a larger coarsening.factor e.g. 2 to 5, in which case the ordinary kriging on residuals will run at a coarser resolution, and the output would be then downscaled to the original resolution using splines (via the gdalwarp method). In the case of predict.method = RK, the kriging variance is derived as a sum of the GLM variance and the OK variance, which is statistically sub-optimal.

See Also

gstatModel-class, fit.gstatModel