[R-sig-Geo] GSTAT-inconsistent predictions KED w spline
Zev Ross
zev at zevross.com
Mon Mar 8 22:31:12 CET 2010
Hi All,
I am getting inconsistent predictions from GSTAT when I have a spline as
part of the external drift while kriging.Can anyone explain why this
might be?
In particular, I noticed that the predictions at a particular point will
depend upon how many observations I have in the "newdata" argument.
Using the meuse data as an example, you'll see that the predictions at
the same first 5 records will be different if I include just those five
records (second example below) or a larger dataset that includes those
five records.
Perhaps using a spline in the drift is not supported and I should use a
polynomial? I prefer using the spline.
Zev
library(splines)
data(meuse)
data(meuse.grid)
coordinates(meuse) = ~x + y
coordinates(meuse.grid) = ~x + y
lznr.vgm = variogram(log(zinc) ~ ns(dist,3), meuse)
lznr.fit = fit.variogram(lznr.vgm, model = vgm(1, "Exp", 300,+ 1))
plot(lznr.vgm, lznr.fit)
preds<-krige(log(zinc) ~ ns(dist,3), meuse, meuse.grid, lznr.fit)
preds[["var1.pred"]][1:5] # these predictions will be different from
those below
data(meuse.grid)
meuse.grid<-meuse.grid[1:5,]
coordinates(meuse.grid) = ~x + y
preds<-krige(log(zinc) ~ ns(dist,3), meuse, meuse.grid, lznr.fit)
preds[["var1.pred"]][1:5] # these predictions are different from those above
--
Zev Ross
ZevRoss Spatial Analysis
120 N Aurora, Suite 3A
Ithaca, NY 14850
607-277-0004 (phone)
866-877-3690 (fax, toll-free)
zev at zevross.com
More information about the R-sig-Geo
mailing list