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

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Mar 22 08:42:01 CET 2012


You also may want to look at R package automap.

On 03/22/2012 07:34 AM, Tom Gottfried wrote:
> 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
> 

-- 
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
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list