https://github.com/cran/gstat
Raw File
Tip revision: b637fa215b99ff28b741104fe6c95ee6b3480a16 authored by Edzer J. Pebesma on 18 October 2004, 00:00:00 UTC
version 0.9-17
Tip revision: b637fa2
cv.R
# try bivariate cokriging; cross validate first variable
library(gstat)
data(meuse)
g=gstat(NULL, "log-zinc", log(zinc)~1,  ~x+y, meuse, nmax=10)
g=gstat(g, "log-lead", log(lead)~1,     ~x+y, meuse, nmax=10)
g=gstat(g, "log-copper", log(copper)~1, ~x+y, meuse, nmax=10)
v=variogram(g)
g=gstat(g, model=vgm(1, "Sph", 1000), fill.all=T)
g=fit.lmc(v, g)
g
set.seed(13131)
summary(gstat.cv(g, remove.all=TRUE, nfold=5))
summary(gstat.cv(g, remove.all=FALSE, nfold=5))
back to top