[R-sig-Geo] fit variogram base on cross validation

Saman Monfared samanmonfared1 at gmail.com
Mon Jan 2 15:20:46 CET 2012


Dear All
I want fit a variogram or cross variogram but not based on
(fit.variogram for direct variogram)
or (fit.lmc
for cross variogram). I think these programs fit variogram based on
minimum SSerr Whereas there is
any guarante that model with minimum SSerr be the best
model.Geostatistics meno in ArcGis10 provide
 a program that it optimize  variogram or cross variogram based on
leave one out cross validation then
the optimized model has the best cross validation in each kriging method.

Is there any program in R that fit variogram or cross variogram based
on cross validation???

For example I want fit a variogram model based on Empirical variogram:

vv<-variogram(d~1, data=dd)
fit.variogram(vv, vgm(0,"Sph",23000,1)
R output:

  model    psill    range
1   Nug    0.000     0.00
2   Sph 1970.996 80843.42

But I know for example that optimum model based on cross validation is:

 model    psill    range
1   Nug    .21     0.00
2   Sph 1540.996 60843.42

How can I use this model in gstat or other packages??

How do I extend it to cross variogram??

for cross variogram :

m<-vgm(0,"Lin",23000,1)
g <- gstat(NULL, id = " B", form =  TB ~ 1,data=dd,fill.cross = F)
g <- gstat(g, id = "E", form = TE~ 1,data=dd,fill.cross = F)
g <- gstat(g, id = "T", form =  T~ 1,data=dd,fill.cross = F)
vm <- variogram(g)
vm.fit <- fit.lmc(vm, g, model=m)
R output:

variograms:
        model        psill range
 B[1]     Nug   0.07360566     0
 B[2]     Lin   0.25714578 60017
E[1]      Nug   2.46512449     0
E[2]      Lin 108.96281576 60017
T[1]      Nug   2.41847897     0
T[2]      Lin  13.22390243 60017
 B.E[1]   Nug  -0.26696750     0
 B.E[2]   Lin   3.26071039 60017
 B.T[1]   Nug  -0.25868233     0
 B.T[2]   Lin  -1.00004909 60017
E.T[1]    Nug   2.21925267     0
E.T[2]    Lin -33.10121223 60017

Whereas I know the best cross variogram based on optimized cross validation is:

variograms:
        model        psill range
 B[1]     Nug   0.04660566     0
 B[2]     Lin   0.34714578 75017
E[1]      Nug   2.54512449     0
E[2]      Lin 123.96281576 75017
T[1]      Nug   4.41847897     0
T[2]      Lin  12.22390243 75017
 B.E[1]   Nug  -1.26696750     0
 B.E[2]   Lin   1.26071039 75017
 B.T[1]   Nug  -1.25868233     0
 B.T[2]   Lin  -2.00004909 75017
E.T[1]    Nug   2.21925267     0
E.T[2]    Lin -23.10121223 75017

What can I do to use a arbitrary variogram model??

-- 

Saman Monfared
Msc Student,
Department of Statistics, Shiraz University,
Shiraz 71454, Iran
Email: Samanmonfared1 at gmail.com

Tel: +98 917 5305167



More information about the R-sig-Geo mailing list