View source: R/gmValidationStrategy.R
validate | R Documentation |
Validate a spatial model by predicting some values. Typically this will be a validation set, or else some subset of the conditing data.
validate(object, strategy, ...)
## S3 method for class 'LeaveOneOut'
validate(object, strategy, ...)
## S3 method for class 'NfoldCrossValidation'
validate(object, strategy, ...)
object |
spatial model object, typically of class |
strategy |
which strategy to follow for the validation? see functions in 'see also' below. |
... |
generic parameters, ignored. |
A data frame of predictions (possibly with kriging variances and covariances, or equivalent uncertainty measures) for each element of the validation set
LeaveOneOut
: Validate a spatial model
NfoldCrossValidation
: Validate a spatial model
Other validation functions:
LeaveOneOut
,
NfoldCrossValidation
Other accuracy functions:
accuracy()
,
mean.accuracy()
,
plot.accuracy()
,
precision()
,
xvErrorMeasures.default()
,
xvErrorMeasures()
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
vs2 = NfoldCrossValidation(nfolds=sample(1:10, nrow(X), replace=TRUE))
vs2
## Not run: v2 = validate(gs, strategy=vs2) # quite slow
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.