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
                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.

  • You could try plotting those points to see if they are exceptional in some way? plot(GLGkrige1, col=1+is.na(GLGkrige1$var1.pred),pch=19) might work to show the NA points in red...
    – Spacedman
    Jun 3 '20 at 11:47
  • I could not get krige.cv to return NA predictions on the meuse data set no matter how I tweaked nmax.
    – Spacedman
    Jun 3 '20 at 12:22
  • Thanks! Indeed, they are all located in the same area. Although not all points in that area result in NAs. I tried tweaking nmax. The smaller the nmax, the lower the number of NAs, it seems. However, I still get 9 NAs with nmax=10 (and I think this is a low value already).
    – ChloeG
    Jun 3 '20 at 13:34
  • I asked a teacher for help, and he found the source of the problem: two points had the same coordinates. I will edit the question. Thank you for your help. :)
    – ChloeG
    Jun 4 '20 at 11:17
  • Please write answers to questions into the area reserved for answers and not into the question.
    – PolyGeo
    Jun 11 '20 at 20:15

The problem came from two points sharing the same coordinates (and different values). With one of these points removed, everything is running smoothly again.

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.