I was asked by my supervisor to create uncertainty maps of kriging interpolation based on the coefficient of variation ((sd/mean)*100%). I used krige function from gstat package to perform the interpolation.

#interpolation using kriging with external drift
krig1 <- krige(xSO4.2009. ~ easting+lograin.2009., dat1, grid.uk, model=fitvar1)

The output produce the prediction values (var1.pred) and the prediction variances (var1.var).

If I want to create the uncertainty map based on the coefficient of variation (COV), does it mean that I just need to use the prediction values and the variance to calculate COV then map it?


Almost. Since the output from kriging is a distribution at every prediction point, you want to divide the sd by the prediction at each point:

 krig1$cov = 100 * sqrt( krig1$var1.var) / krig1$var1.pred

Your code which looks like this:

 krig1$cov = 100 * sqrt( krig1$var1.var) / mean(krig1$var1.pred)

is the variance multiplied by a constant everywhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.