validate.predictions(data, pred, se.pred, statistic = c("crps", "pit", "mc", "bs", "st"), ncutoff = NULL)
"plot"(x, type = c("sc", "lgn.sc", "ta", "qq", "hist.pit", "ecdf.pit", "mc", "bs"), smooth = TRUE, span = 2/3, ncutoff = NULL, add = FALSE, col, pch, lty, main, xlab, ylab, ...)
"print"(x, digits = max(3, getOption("digits") - 3), ...)
"rstudent"(model, ...)
"summary"(object, se = FALSE, ...)"crps": continuous ranked probability score (default),
"pit": probability integral transform,
"mc": average predictive distribution (marginal
calibration),
"bs": Brier score,
"st": mean and dispersion statistics of (standardized)
prediction errors.
type = "mc"), or the number of
thresholds for which the Brier score is computed (type = "bs"),
see Details (default: min(500, length(data))).cv.georob.plot.cv.georob. Possible values are:
"sc": a scatterplot of the (possibly log-transformed) response
vs. the respective predictions (default).
"lgn.sc": a scatterplot of the untransformed response
against back- transformed predictions of the log-transformed response.
"ta": Tukey-Anscombe plot (plot of standardized prediction
errors vs. predictions).
"qq": normal QQ plot of standardized prediction errors.
"hist.pit": histogram of probability integral transform, see
Details.
"ecdf.pit": empirical cdf of probability integral
transform, see Details.
"mc": a marginal calibration plot, see Details,
"bs": a plot of Brier score vs. threshold, see
Details.
loess.smooth.loess.smooth).FALSE).FALSE).statistic, the function
validate.predictions returnsstatistic is equal to "pit",statistic is equal to "st". The
following statistics are computed:
me |
| mean prediction error |
mede |
| median prediction error |
rmse |
| root mean squared prediction error |
made |
| median absolute prediction error |
qne |
Qn dispersion measure of prediction errors
(see Qn) |
msse |
| mean squared standardized prediction error |
medsse |
| median squared standardized prediction error |
statistic is equal to "mc" or
"bs" with the components (see Details):
z |
the sorted unique (cross-)validation
observations (or a subset of size
ncutoff of them) |
ghat |
| the empirical CDF of the (cross-)validation observations $hat{G}_n(y)$ |
fbar |
| the average predictive distribution $barF_n(y)$ |
bs |
| the Brier score $BS(y)$ |
rstudent.cv.georob returns a numeric vector with
the standardized cross-validation prediction errors. validate.predictions computes the items required to evaluate (and
plot) the diagnostic criteria proposed by Gneiting et al. (2007) for
assessing the calibration and the sharpness of
probabilistic predictions. To this aim, validate.predictions uses
the assumption that the prediction errors
$Y(s)-hatY(s)$
follow normal distributions with zero mean and standard deviations equal
to the kriging standard errors. This assumption is used to compute
$$\mathrm{CRPS} = \int_{-\infty}^\infty \mathrm{BS}(y) \,dy.$$
Gneiting et al. (2007) proposed the following plots to validate probabilistic predictions:
The plot method for class cv.georob allows to create
these plots, along with scatterplots of observations and predictions,
Tukey-Anscombe and normal QQ plots of the standardized prediction
errors.
summary.cv.georob computes the mean and dispersion statistics
of the (standardized) prediction errors (by a call to
validate.prediction with argument statistic = "st", see
Value) and the averaged continuous ranked probability score
(crps). If present in the cv.georob object, the error
statistics are also computed for the errors of the unbiasedly
back-transformed predictions of a log-transformed response. If se
is TRUE then these statistics are evaluated separately for the
$K$ cross-validation subsets and the standard errors of the means of
these statistics are returned as well.
The print method for class cv.georob returns the mean
and dispersion statistics of the (standardized) prediction errors.
The method rstudent returns for class cv.georob the
standardized prediction errors.
georob for (robust) fitting of spatial linear models;
cv.georob for assessing the goodness of a fit by georob.
## Not run:
# data(meuse)
#
# r.logzn <- georob(log(zinc) ~ sqrt(dist), data = meuse, locations = ~ x + y,
# variogram.model = "RMexp",
# param = c(variance = 0.15, nugget = 0.05, scale = 200),
# tuning.psi = 1)
#
# r.logzn.cv.1 <- cv(r.logzn, seed = 1, lgn = TRUE)
# r.logzn.cv.2 <- cv(r.logzn, formula = .~. + ffreq, seed = 1, lgn = TRUE)
#
# summary(r.logzn.cv.1, se = TRUE)
# summary(r.logzn.cv.2, se = TRUE)
#
# op <- par(mfrow = c(2,2))
# plot(r.logzn.cv.1, type = "lgn.sc")
# plot(r.logzn.cv.2, type = "lgn.sc", add = TRUE, col = "red")
# abline(0, 1, lty= "dotted")
# plot(r.logzn.cv.1, type = "ta")
# plot(r.logzn.cv.2, type = "ta", add = TRUE, col = "red")
# abline(h=0, lty= "dotted")
# plot(r.logzn.cv.2, type = "mc", add = TRUE, col = "red")
# plot(r.logzn.cv.1, type = "bs")
# plot(r.logzn.cv.2, type = "bs", add = TRUE, col = "red")
# legend("topright", lty = 1, col = c("black", "red"), bty = "n",
# legend = c("log(Zn) ~ sqrt(dist)", "log(Zn) ~ sqrt(dist) + ffreq"))
# par(op)## End(Not run)
Run the code above in your browser using DataLab