"gstatModel"
Predicts from an object of class gstatModel-class
using new prediction locations. The function combines predictions by regression (e.g. GLM) and interpolation of residuals (kriging) via the Regression-Kriging (RK) or Kriging with External Drift (KED, also known as Universal Kriging) framework.
# S4 method for gstatModel
predict(object,
predictionLocations, nmin = 10, nmax = 30, debug.level = -1,
predict.method = c("RK", "KED"), nfold = 5, verbose = FALSE,
nsim = 0, mask.extra = TRUE, block,
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), extend = .5, …)
# S4 method for list
predict(object,
predictionLocations, nmin = 10, nmax = 30, debug.level = -1,
predict.method = c("RK", "KED"), nfold = 5, verbose = FALSE,
nsim = 0, mask.extra = TRUE, block,
zmin = -Inf, zmax = Inf, subsample = length(object@sp), …)
object of type "gstatModel"
object of type "SpatialPixelsDataFrame"
prediction locations (must contain all covariates from the model)
integer; minimum number of nearest observations sent to gstat::krige
integer; maximum number of nearest observations sent to gstat::krige
integer; default debug level mode sent to gstat::krige
character; mathematical implementation of the gstat::krige
interpolation method with covariates: Regression-Kriging (RK) or Kriging with External Drift (KED)
integer; n-fold cross validation sent to gstat::krige.cv
logical; specifies whether to supress the progress bar of the gstat::krige.cv
integer; triggers the geostatistical simulations
logical; specifies whether to mask out the extrapolation pixels (prediction variance exceeding the global variance)
numeric; support size (block support for objects of type "SpatialPixelsDataFrame"
is chosen by default)
numeric; lower physical limit for the target variable
numeric; upper physical limit for the target variable
integer; sub-sample point observations to speed up the processing
integer; coarsening factor (1:5) to speed up the processing
object of class data.frame
corresponding to the gstat::vgm
variogram
logical; vector specifying the subset of observations used for interpolation
numeric; fraction of the range for which the spatial domain should be extended when searching for observations for kriging
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
Selecting predict.method = "KED"
invokes simple kriging with external drift with betas set at 0 (intercept) and 1 (regression predictions used as the only 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 (extend
). In the case of spatial duplicates in 2D or 3D, subset.observations
will automatically remove all duplicates before running kriging. All points in 3D that stand exactly above each other will be removed by default.
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 warp
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.
Hengl T., Heuvelink G.B.M., Rossiter D.G., 2007. About regression-kriging: from equations to case studies. Computers and Geosciences, 33(10): 1301-1315.