[R-sig-Geo] krige.cv with nfold=1

Edzer Pebesma edzer.pebesma at uni-muenster.de
Wed Sep 17 14:55:15 CEST 2008


n-fold cross validation splits the data in n parts, and each time holds 
one part out to compare it with predictions from the remaining part. So, 
having nfold=1 does not make sense.

I will add to the documentation that nfold should be 2 or larger.
--
Edzer

Francois JOUVIE wrote:
> Hello All,
>
> I'm using for the first time the gstat command  krige.cv for cross 
> validation.
>
> Having some problems to perform with my own data, I tried with the 
> data included with R which are often used in presentations (meuse data 
> more precisely).
> Then I tried the following commands which all perform:
>
> > data(meuse)
> > m<-vgm(.5,"Sph",900,0.04)
> > x<-krige.cv(log(zinc)~1,~x+y,meuse,m,nfold=5)
> [using ordinary kriging]
> [using ordinary kriging]
> [using ordinary kriging]
> [using ordinary kriging]
> [using ordinary kriging]
> >
>
> But if I want  nfold=1 (= not sub_divisions of the data ?) I get this 
> (in French) :
>
> > x<-krige.cv(log(zinc)~1,~x+y,meuse,m,nfold=1)
> Erreur dans gstat.formula(d$formula, d$data) :
>   no response variable present in formula
> De plus : Warning messages:
> 1: In min(x) : aucun argument trouvé pour min ; Inf est renvoyé
> 2: In max(x) : aucun argument pour max ; -Inf est renvoyé
> 3: In min(x) : aucun argument trouvé pour min ; Inf est renvoyé
> 4: In max(x) : aucun argument pour max ; -Inf est renvoyé
> >
>
> What is happens ?
>
> Thanks you very much if you can help me.
>
> Francois
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster,
Weseler Straße 253, 48151 Münster, Germany.  Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de/




More information about the R-sig-Geo mailing list