Leave-one-our-cross-validation statistics.

Share:

Description

A function which get some common summary stats of a leave-one-out-cross-validation.

Usage

1
LOOCV(Xvalid)

Arguments

Xvalid

The results from either the xvalid function of geoR or the krige.cv function of the gstat package.

Details

A quick function to to summarise the results of LOOCV.

Value

RMSE

Root mean square error of the LOOCV.

ME

Mean error of the LOOCV.

thetaMean

mean theta.

thetaMedian

median theta.

Author(s)

Jason Lessels jlessels@gmail.com

Examples

1
2
3
4
5
6
7
8
9
reml <- likfitRcpp(s100, ini=c(0.5, 0.5), fix.nug = FALSE, lik.met = "REML")
# Perform cross validation using gstat and geoR methods.
krige_data <- data.frame(data=s100$data, x=s100$coords[,1], y=s100$coords[,2])
model. <- vgm(psill=reml$sigmasq, "Exp", range=reml$phi, reml$nugget)
system.time(gstatXV <- krige.cv(formula=data~1, locations=~x+y, data=krige_data,model=model.))
system.time(geoRXV <- xvalid(s100, model=reml))
# Getting a quick summary of the cross validation results
LOOCV(geoRXV)
LOOCV(gstatXV)