November 2018
Beginner to intermediate
354 pages
6h 59m
English
We can check how well our kriging model is doing in modeling the data and in predicting. We can use cross-validation, which divides data into two parts—training and validation—where we fit the variogram model to the training set and the kriging model on the validation set. We then compare prediction on the validation set with the measured value on the training set.
Let's create training data with 70% of the meuse data and create validation data with the remaining 30%:
no_rows = dim(meuse@data)[1]sample_size = floor(0.75 * no_rows)train_no = sample(seq_len(no_rows), size = sample_size)train = meuse[train_no, ]validation = meuse[-train_no, ]
Now, fit a variogram to the training data:
# In vgm, first argument is partial sill, ...
Read now
Unlock full access