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) 

Arguments

... autoKrige.cv objects that are compared to each other
col.names Names for the different objects in .... This defaults to A for the first object, B for the second, etc.
bubbleplots logical, if TRUE then bubble plots of the objects in ... are drawn using the same value for the color breaks.
zcol Which column in the objects in ... is going to be drawn in the bubbleplots. Options are: var1.pred, var1.var, observed, residual and zscore.
layout layout of the bubbleplot, e.g. c(2,2). The argument gives the number of rows and columns in which the set of bubbleplots is to be drawn. Useful defaults are selected.
key.entries A list of numbers telling what the key entries in the bubbleplots are. See bubble for more details.
reference An integer telling which of the objects should be taken as a reference if plot.diff equals TRUE. reference equal to 1 means that the first object is the reference, reference equal to 2 means that the second object is the reference etc.
plot.diff logical, if plot.diff is TRUE the number specified in reference defines the CV object that is taken as a reference What is shown in the plot is reference data squared minus the other data squared. So the color red means that the CV is doing worse than the reference, vice-versa for green. This is very useful to see where the differences between the results are spatially and if there is a pattern.

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.
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.
URMSE Unbiased Root Mean Squared Error of the residual. Ideally small.
iqr Interquartile Range of the residuals. Ideally small.

Author(s)

Paul Hiemstra, p.hiemstra@geo.uu.nl

See Also

krige.cv, bubble, autofitVariogram, autoKrige.cv,

Examples

# Load the data
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"))
kr_dist.cv = autoKrige.cv(log(zinc)~sqrt(dist), meuse, 
           model = c("Exp"))
kr_dist_ffreq.cv = autoKrige.cv(log(zinc)~sqrt(dist)+ffreq, 
           meuse, model = c("Exp"))

# 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)

[Package automap version 1.0-0 Index]