Hi Zev, it seems that gls returns the relative nugget rather than the absolute returned by gstat:
> 1.30231/(1.413246+1.30231) [1] 0.479574 Could that be? I'm quite surprised results are that similar, doesn't gls use REML to fit variograms? Best wishes from a vivid geostat 2010, On 07/01/2010 04:53 PM, Zev Ross wrote: > Hi All, > > I'm verifying coefficients generated with GSTAT kriging with external > drift using GLS. The coefficients match absolutely perfectly. The range > also matches perfectly. But there is a big difference in what GLS gives > as the output for the nugget. Can anyone explain why this is? > > Zev > > ###### KED > > # here's where I fit the variogram and the fit output > > v.fit = fit.variogram(v, vgm(1.5, "Exp", 20, 0.5)) > >> v.fit > model psill range > 1 Nug 1.302310 0.0000000 > 2 Exp 1.413246 0.8098587 > > # the fit is used in a KED model > g = gstat(formula=formula(MODEL), data = so2, model = v.fit) > > # here I get the coefs (these coefs match those from GLS below perfectly) > UKcoef<-predict(g, lattice, BLUE=c(TRUE,TRUE)) > > ###### GLS > > # use the same parameters as above and fix them > > nug<-v.fit[1,2] # this is 1.302 > sill<-v.fit[1,2]+v.fit[2,2] > range<-v.fit[2,3] > > theGLS<-gls(formula(so2FinalAll), data=so2, na.action=na.omit, > correlation=corExp(c(range, nug/sill ), > form=~X+Y, nugget=TRUE,fixed=TRUE), method="ML") > >> summary(theGLS) > Generalized least squares fit by maximum likelihood > Model: formula(so2FinalAll) > Data: so2 > AIC BIC logLik > 578.6551 593.7083 -284.3275 > > Correlation Structure: Exponential spatial correlation > Formula: ~X + Y > Parameter estimate(s): > range nugget > 0.8098587 0.4795740 > > # note the nugget of 0.479 vs the 1.302 above. > -- 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.pebe...@wwu.de _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo