compare.cv {automap} | R Documentation |
Comparing the results of cross-validations
Description
Allows comparison of the results from several outcomes of autoKrige.cv
in both statistics and spatial plots
(bubble plots).
Usage
compare.cv(...,
col.names,
bubbleplots = FALSE,
zcol = "residual",
layout,
key.entries,
reference = 1,
plot.diff = FALSE,
digits = 4,
ggplot = FALSE,
addPoly = NULL)
Arguments
... |
|
col.names |
Names for the different objects in |
bubbleplots |
logical, if |
zcol |
Which column in the objects in |
layout |
|
key.entries |
A list of numbers telling what the key entries in the bubbleplots are. See |
reference |
An integer telling which of the objects should be taken as a reference if |
plot.diff |
logical, if |
digits |
The number of significant digits in the resulting data.frame. |
ggplot |
logical, determines if spplot or ggplot2 is used to make the spatial plot of the cross-validation residuals.
Note that the |
addPoly |
if this object contains a |
Value
A data.frame with for each cross-validation result a number of diagnostics:
mean_error |
The mean of the cross-validation residual. Ideally small. |
me_mean |
mean error divided by the mean of the observed values, measure for how large the mean_error is in contrast to the mean of the dataset |
MSE |
Mean Squared error. |
MSNE |
Mean Squared Normalized Error, mean of the squared z-scores. Ideally small. |
cor_obspred |
Correlation between the observed and predicted values. Ideally 1. |
cor_predres |
Correlation between the predicted and the residual values. Ideally 0. |
RMSE |
Root Mean Squared Error of the residual. Ideally small. |
RMSE_sd |
RMSE divided by the standard deviation of the observed values. Provides a measure variation of the residuals vs the variation of the observed values. |
URMSE |
Unbiased Root Mean Squared Error of the residual. Ideally small. |
iqr |
Interquartile Range of the residuals. Ideally small. |
Author(s)
Paul Hiemstra, paul@numbertheory.nl
See Also
krige.cv
, bubble
, autofitVariogram
, autoKrige.cv
,
Examples
# Load the data
library(sp)
data(meuse)
coordinates(meuse) = ~x+y
data(meuse.grid)
gridded(meuse.grid) = ~x+y
# Perform cross-validation
kr.cv = autoKrige.cv(log(zinc)~1, meuse, model = c("Exp"), nfold = 10)
kr_dist.cv = autoKrige.cv(log(zinc)~sqrt(dist), meuse,
model = c("Exp"), nfold = 10)
kr_dist_ffreq.cv = autoKrige.cv(log(zinc)~sqrt(dist)+ffreq,
meuse, model = c("Exp"), nfold = 10)
# Compare the results
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv)
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv,
bubbleplots = TRUE)
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv,
bubbleplots = TRUE, col.names = c("OK","UK1","UK2"))
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv,
bubbleplots = TRUE, col.names = c("OK","UK1","UK2"),
plot.diff = TRUE)
library(ggplot2)
compare.cv(kr.cv, kr_dist.cv, kr_dist_ffreq.cv,
bubbleplots = TRUE, col.names = c("OK","UK1","UK2"),
ggplot = TRUE)