[R-sig-Geo] semivariogram calculation - discrepancy between gls and gstat

Guido Lorenz glorenz2000 at yahoo.com
Tue Jul 6 23:35:39 CEST 2010


Dear Edzer Pebesma,

thank your for your advice - you were right that the semivariance values are standardized by default in the output of the nlme-Variogram function. So, with the adequate "resType"-option in that function, I could reproduce nearly the same estimations as in the gstat module:

> Variogram(lmm.dap2b, resType="response")
        variog      dist n.pairs
1  0.005385495  2.828427     122
2  0.007111336  4.269282     125
3  0.010111828 18.110770     123
4  0.009269399 20.000000     125
5  0.006815940 21.603952     126
....
The detailed information about the Variogram function, with all the possible options, is found in the manual of the nlme package and not in the interactive help, so at the moment of my first mail, I had not read these details about the different modifiers. 

Many thanks for your help,
Guido Lorenz 


----- Original Message ----
From: Edzer Pebesma <edzer.pebesma at uni-muenster.de>
To: r-sig-geo at stat.math.ethz.ch
Sent: Tue, July 6, 2010 3:25:50 AM
Subject: Re: [R-sig-Geo] semivariogram calculation - discrepancy between gls and gstat

Guido, I suspect that nlme works with models for spatial correlation and
not for spatial covariance, meaning that the variance (variog) gets
standardized - see ?corClasses in nlme. Do the variog values approach 1
for longer distances?

On 07/05/2010 11:02 PM, Guido Lorenz wrote:
> Dear R-sig-Geo members,
> 
> a semivariogram for spatial soil data, calculated by the gls (nlme library) function gives the following estimates:
> 
>> lmm.dap2b <- gls(Dap.sa ~ 1 + ID.sitio, Pd2006mm, correlation=corGaus(form=~(easting.m+northing.m)|ID.sitio, nugget=TRUE, metric="euclidean"), na.action=na.omit, method="REML")
>> Variogram(lmm.dap2b)
>       variog      dist n.pairs
> 1  0.3059585  2.828427     122
> 2  0.4040062  4.269282     125
> 3  0.5744688 18.110770     123
> 4  0.5266091 20.000000     125
> ....
> 
> whereas the variogram function of the gstat library gives, for similar distances (although different number of sample pairs), very different gamma values: 
> 
>  > variogram(Dap.sa ~ 1, locations = ~ easting.m + northing.m, data=Pd2006mm, cutoff=80)
>     np      dist       gamma dir.hor dir.ver   id
> 1  219  3.225693 0.005578128       0       0 var1
> 2   20  6.478671 0.004254656       0       0 var1
> 3    3 13.513045 0.009896324       0       0 var1
> 4  307 19.201322 0.009708390       0       0 var1
> .....  
> 
> Can anyone explain what is happening?
> 
> Thanks for any advice,
> Guido Lorenz
> 
> Can anyone explain
> 
> _______________________________________________
> 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
http://www.52north.org/geostatistics      e.pebesma at wwu.de

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo







More information about the R-sig-Geo mailing list