I have a set of measurements for a variable Z over a non uniform grid in X and Y. For each Z value I have a mean plus a variance of the measurement. That is, I have a data set (Zmean_i,Zvariance_i,X_i,Y_i) i=1..N. In other words, some estimates of the variable Z are more reliable than others, and that uncertainty is quantified in Zvariance. If I only take into account the mean Z value the process for predicting the Z values on a new data Grid (GridXY) is clear (SP is the spatial data frame with X and Y as coordinates and Zmean as values)
v <- autofitVariogram(Zmean~X+Y,SP) Zpredicted <- krige(Zmean~X+Y,SP,GridXY,model=v$var_model)
When using the gstat package, How would I take into account the variance of each Z value (Zvariance) both in fitting the variogram model and also in making predicitions?