I recently completed a geostatistics course, and now trying to apply my knewly acquired knowledge to a real case. I have a dataset with 2 122 groundwater level measurement points. I would like to extrapolate them into a raster map. The previous group that worked on this matter used some inverse distance weighting. But I thought kriging might make more sense. Which is why I decided to try it out and perform some LOOCV to compare methods. I do not have any NA in the original dataset, but when using function krige.cv(), I get 85 NAs. This messes up with computing zscore statistics. I would like to know why I have these NA values, and whether it is fine to simply remove them.
This is my call of the function:
GLGkrige1 <- krige.cv(GLG~1, ground_water_points, model=vgmGLG, nmax=100) And this is the summary of the result:
Object of class SpatialPointsDataFrame Coordinates: min max coords.x1 4.749619 5.017867 coords.x2 52.289492 52.425470 Is projected: NA proj4string : [NA] Number of points: 2122 Data attributes: var1.pred var1.var observed residual zscore fold Min. :-5.2735 Min. :0.0000 Min. :-5.630 Min. :-1.77453 Min. :-25624692 Min. : 1.0 1st Qu.:-1.9587 1st Qu.:0.2195 1st Qu.:-2.040 1st Qu.:-0.12146 1st Qu.: 0 1st Qu.: 531.2 Median :-0.8083 Median :0.2301 Median :-0.810 Median : 0.00069 Median : 0 Median :1061.5 Mean :-1.3896 Mean :0.2390 Mean :-1.463 Mean : 0.00135 Mean : 0 Mean :1061.5 3rd Qu.:-0.4698 3rd Qu.:0.2467 3rd Qu.:-0.460 3rd Qu.: 0.12386 3rd Qu.: 0 3rd Qu.:1591.8 Max. : 0.7157 Max. :1.7875 Max. : 1.590 Max. : 3.55142 Max. : 25624692 Max. :2122.0 NA's :85 NA's :85 NA's :85 NA's :85 I just noticed that my first run on the krige.cv() where I forgot to set a nmax has 1488 NAs, so I suspect this has to do with the nmax.
Could these be points that do not have enough neighbours?
The problem came from two points sharing the same coordinates (and different values). Now everything is running smoothly again.
plot(GLGkrige1, col=1+is.na(GLGkrige1$var1.pred),pch=19)might work to show the NA points in red...krige.cvto return NA predictions on themeusedata set no matter how I tweakednmax.