[R-sig-Geo] how to choose best parameters of variogram model in gstat

Tom Gottfried tom.gottfried at tum.de
Thu Mar 22 07:34:39 CET 2012


Jessie,

Am 22.03.2012 07:05, schrieb Jessie Zhang:
> Dear all,
>
> I’m very confused about kriging interpolation using package “gstat”. As I
> know, there are two steps to do kriging interpolation. Firstly, define the
> variogram structure of the sample data and choose the best parameters (Sill,
> nugget and range). Secondly, predict the values of the unknown locations. I
> want to interpolate the daily concentration of PM10 using Kriging with 27
> observed stations for three years (1109 days).
>
> My questions as follow:
> 1.  How to choose the best parameters of model, by visual fit or statistical
> fit? I attached my program and results for visual fit. Where was I wrong?
> For statistical fit, what should I do?

?fit.variogram

> ##visual fit##
> data<-read.csv("pm.csv",header=T)
> http://r-sig-geo.2731867.n2.nabble.com/file/n7394459/pm.csv pm.csv
> coordinates(data)<-~x+y
> d<-variogram(pm10~1,data)
> plot(d)##Figure 1##
> http://r-sig-geo.2731867.n2.nabble.com/file/n7394459/Figure_1.png
>
> ## as display in the figure, I choose the parameters like b##
> b<-vgm(2500,"Sph",0.2,100)
> plot(d,model=b)##Figure 2
> http://r-sig-geo.2731867.n2.nabble.com/file/n7394459/Figure_2.png
>
> 2.  As the variogram structure is very different for each day, I think it’s
> better to define the parameters day by day. I need to do it for 1109 times.
> Is it possible to do it automatically?

E.g. in a loop (?for) ...

varmods <- list()
for (i in 1:1109) varmods[[i]] <- fit.variogram(d, b)

...or by means of lapply and the like. Maybe your interested in the 
package automap too.

Tom

> Thanks a lot for everyone.
>
> Jessie zhang
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/how-to-choose-best-parameters-of-variogram-model-in-gstat-tp7394459p7394459.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Technische Universität München
Department für Pflanzenwissenschaften
Lehrstuhl für Grünlandlehre
Alte Akademie 12
85350 Freising / Germany
Phone: ++49 (0)8161 715324
Fax:   ++49 (0)8161 713243
email: tom.gottfried at wzw.tum.de
http://www.wzw.tum.de/gruenland



More information about the R-sig-Geo mailing list