cov.plot | R Documentation |
This function plots the central prediction interval coverage for different interval ranges of selected models as line plot.
cov.plot(
x,
models,
nominal.coverage,
colors = NULL,
title = "Interval Coverage",
legend = "right"
)
x |
matrix of central prediction interval coverages of different models in % |
models |
character; column names of |
nominal.coverage |
numeric; nominal coverages in % (see details) |
colors |
character; color for each object in |
title |
character; title of the plot; default: " |
legend |
character; position of the legend; default: " |
For matrix x
, each column contains the central prediction interval coverages of a different model in %. Consequently
the i-th row entries of x
correspond to the i-th entry in nominal.coverage
. In addition each entry in models
and colors
refers to
the respective column of x
. NA's are omitted.
For the parameter legend
the following options are available: "right
", "left
", "bottom
", "top
", "hide
".
The closer the points/a line plot to the dashed line is, the more calibrated the model is.
ggplot object with line plots of the central prediction interval coverages of different models.
David Jobst
# simulated data
n <- 30
x <- matrix(runif(n)*100, ncol = 3)
x <- apply(x, 2, sort)
models <- c("A", "B", "C")
nominal.coverage <- seq(5, 95, length.out = 10)
colors <- c("darkred", "steelblue", "orange")
title <- "Interval Coverage Comparison"
legend <- "bottom"
# cov.plot plot
cov.plot(x = x, models = models, nominal.coverage = nominal.coverage)
cov.plot(x = x, models = models, nominal.coverage = nominal.coverage,
colors = colors, title = title, legend = legend)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.