gmGeostats (version 0.10-6)

validate: Validate a spatial model

Description

Validate a spatial model by predicting some values. Typically this will be a validation set, or else some subset of the conditing data.

Usage

validate(object, strategy, ...)

# S3 method for LeaveOneOut validate(object, strategy, ...)

# S3 method for NfoldCrossValidation validate(object, strategy, ...)

Arguments

object

spatial model object, typically of class gstat::gstat() or '>gmSpatialModel

strategy

which strategy to follow for the validation? see functions in 'see also' below.

...

generic parameters, ignored.

Value

A data frame of predictions (possibly with kriging variances and covariances, or equivalent uncertainty measures) for each element of the validation set

Methods (by class)

  • LeaveOneOut: Validate a spatial model

  • NfoldCrossValidation: Validate a spatial model

See Also

Other validation functions: LeaveOneOut, NfoldCrossValidation

Other accuracy functions: accuracy(), mean.accuracy(), plot.accuracy(), precision(), xvErrorMeasures()

Examples

Run this code
# NOT RUN {
data("Windarling")
X = Windarling[,c("Easting","Northing")]
Z = compositions::acomp(Windarling[,c(9:12,16)])
gm = make.gmCompositionalGaussianSpatialModel(data=Z, coords=X)
vg = variogram(gm)
md = gstat::vgm(range=30, model="Sph", nugget=1, psill=1)
gs = fit_lmc(v=vg, g=gm, model=md) 
# }
# NOT RUN {
 v1 = validate(gs, strategy=LeaveOneOut()) # quite slow 
# }
# NOT RUN {
vs2 = NfoldCrossValidation(nfolds=sample(1:10, nrow(X), replace=TRUE))
vs2
# }
# NOT RUN {
 v2 = validate(gs, strategy=vs2) # quite slow 
# }

Run the code above in your browser using DataLab