0

I did kriging using spPredict from spBayes package for Bayesian kriging and krige from gstat package for non-Bayesian kriging. I didn't use any covariates (only constant mean term) and used 1283 points for kriging. Out of 1283 points, 1012 are new locations and 271 are locations where I have data.

After finishing the kriging, to check the predictive performance I looked into the kriged values of 271 locations. And then I realized they are exactly same as the data for 271 locations. I have done kriging with the same code (but with covariates) and haven't had this kind of problem at all. I have no idea what is going wrong... Here are my simple code for spPredict and krige. I also attach the calibration plot. I would appreciate a lot for any advice.

pred.covar=cbind(rep(1,1283))
spPredict(fitted, pred.coords=grid.fin_km, pred.covars=pred.covar,
                   start = burn.in, thin = 10, verbose=FALSE)
krige(formula=n_temp~1, locations=~x1+x2, data=merged.f, newdata=grid.fin_km,
         model=var.fit.w1)

enter image description here

Catarina Ferreira
  • 1,824
  • 5
  • 17
  • 26
Donna
  • 11
  • 1
  • 5

1 Answers1

0

This is a well-known property of kriging; it comes from the fact that the model underlying kriging assumes that a value is perfectly correlated with itself. Predicting a known value than always results in that value, with zero prediction error. It is also the cause of errors resulting from duplicate observations at the same observation location.

If you don't want this to happen, what you want is smoothing or filtering; you're assuming a process S(x) = Z(x) + e(x), where the observations are of Z, and you want to predict S; this is not what kriging does. In package gstat you can get filtering when you specify an Err variogram component instead of a Nug nugget effect.

Edzer Pebesma
  • 3,814
  • 16
  • 26