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?
pred<-krig1@data$var1.pred
var<-krig1@data$var1.var
krig1$cov<-(sqrt(var)/mean(pred))*100