Skip to content

Large Prediction Variances with gstat

1 message · Edzer Pebesma

#
predict.lm gives prediction errors for the mean, where gstat gives 
prediction errors for single observations, identical to

 > summary(pred.variance) + lm.zn.pred$residual.scale^2
     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
0.224297 0.231328 0.233698 0.236858 0.240198 0.301258

If you ask gstat to make predictions for blocks, using linear 
regression, it predicts the mean instead of individual observations, 
which is equivalent to kriging with a pure nugget effect:

 > gstat.lm.zn.pred<-krige(log(zinc)~x+y+elev, dat.mod, 
newdata=dat.pred, block=1)
[ordinary or weighted least squares prediction]
 > summary(gstat.lm.zn.pred at data) #gstat results
    var1.pred        var1.var
  Min.   :4.061   Min.   :0.006409
  1st Qu.:4.974   1st Qu.:0.013438
  Median :5.335   Median :0.015809
  Mean   :5.303   Mean   :0.018970
  3rd Qu.:5.618   3rd Qu.:0.022309
  Max.   :6.262   Max.   :0.083373
On 02/28/2013 09:20 PM, Jesse Berman wrote: