[R-sig-Geo] residual variograms for simple or universal kriging

Tom Gottfried tom.gottfried at wzw.tum.de
Fri Mar 25 14:42:32 CET 2011


Hi list,

it seems I miss something of how to specify trend parameters for computing a residual variogram for 
simple kriging when doing as follows:

library(gstat)
data(meuse)
coordinates(meuse) <- ~x+y

# residual variogram for universal kriging
meuse_universal <- gstat(NULL, "zinc", zinc~dist,
                          subset(meuse, meuse$landuse=="Ah"))
residvar_universal <- variogram(meuse_universal)
lm_universal <- lm(zinc~dist, subset(meuse, meuse$landuse=="Ah"))

# residual variogram for simple kriging
meuse_simple <- gstat(NULL, "zinc", zinc~dist,
                       subset(meuse, meuse$landuse=="Ah"),
                       beta=coefficients(lm(zinc~dist, meuse)))
residvar_simple <- variogram(meuse_simple)
lm_simple <- lm(zinc~dist, meuse)

identical(coefficients(lm_universal), coefficients(lm_simple))
identical(residvar_universal, residvar_simple)

The next to last line shows that the linear models differ for the subset used in meuse_universal and 
the whole dataset given for the calculation of parameters for meuse_simple. Nevertheless, the 
variograms are identical. As variogram() can not know about the whole dataset when computing 
resdivar_universal, I conclude that what I give as beta argument for meuse_simple and thus 
residvar_simple is not taken into account.

Any help?
Thanks,
Tom

-- 
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