gmGeostats (version 0.11.3)

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

Value

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

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.

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.default(), xvErrorMeasures()

Examples

Run this code
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) 
if (FALSE)  v1 = validate(gs, strategy=LeaveOneOut()) # quite slow 
vs2 = NfoldCrossValidation(nfolds=sample(1:10, nrow(X), replace=TRUE))
vs2
if (FALSE)  v2 = validate(gs, strategy=vs2) # quite slow 

Run the code above in your browser using DataLab