An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20080708/34fe87cb/attachment.pl>
why are idw and gstat different? [SEC=UNCLASSIFIED]
2 messages · Li Jin, Edzer Pebesma
Jin, you specified nmax = 7 in the second call, but not in the first. Comparing idp values is easiest when other things remain equal. -- Edzer
Jin.Li at ga.gov.au wrote:
Dear there, I tried to compare idw and gstat in library(gstat). I specified idp as 0.5 in both functions, I expected identical results, but what I got are different as shown for the first five samples. Please help. Thanks.
data(meuse)
coordinates(meuse) = ~x+y
data(meuse.grid)
gridded(meuse.grid) = ~x+y
x <- idw(zinc~1, meuse, meuse.grid, idp=0.5)
[inverse distance weighted interpolation]
as.data.frame(x)[1:5,]
var1.pred var1.var x y 1 482.8753 NA 181180 333740 2 487.0065 NA 181140 333700 3 483.9747 NA 181180 333700 4 481.2115 NA 181220 333700 5 494.8720 NA 181100 333660
data(meuse)
data(meuse.grid)
meuse.gstat <- gstat(id = "zinc", formula = zinc ~ 1, locations = ~ x + y,
+ data = meuse, nmax = 7, set = list(idp = .5))
meuse.gstat
data: zinc : formula = zinc`~`1 ; data dim = 155 x 12 nmax = 7 set idp = 0.5; ~x + y
z <- predict(meuse.gstat, meuse.grid)
[inverse distance weighted interpolation]
z[1:5,]
x y zinc.pred zinc.var
1 181180 333740 626.3628 NA
2 181140 333700 645.9319 NA
3 181180 333700 629.7041 NA
4 181220 333700 615.1368 NA
5 181100 333660 682.3401 NA
Cheers,
Jin
--------------------------------------------
Jin Li, PhD
Spatial Modeller/
Computational Statistician
Marine & Coastal Environment
Geoscience Australia
Ph: 61 (02) 6249 9899
Fax: 61 (02) 6249 9956
email: jin.li at ga.gov.au <mailto:jin.li at ga.gov.au>
--------------------------------------------
[[alternative HTML version deleted]]
_______________________________________________ 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. Phone: +49 251 8333081 Fax: +49 251 8339763 email: edzer.pebesma at uni-muenster.de http://ifgi.uni-muenster.de/