cov.plot: Central Prediction Interval Coverage Model Comparison

View source: R/cov.plot.R

cov.plotR Documentation

Central Prediction Interval Coverage Model Comparison

Description

This function plots the central prediction interval coverage for different interval ranges of selected models as line plot.

Usage

cov.plot(
  x,
  models,
  nominal.coverage,
  colors = NULL,
  title = "Interval Coverage",
  legend = "right"
)

Arguments

x

matrix of central prediction interval coverages of different models in %

models

character; column names of x (depending on x; see details)

nominal.coverage

numeric; nominal coverages in % (see details)

colors

character; color for each object in models; default: ggplot2 setting (depending on x; see details)

title

character; title of the plot; default: "Interval Coverage"

legend

character; position of the legend; default: "right" (see details)

Details

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.

Value

ggplot object with line plots of the central prediction interval coverages of different models.

Author(s)

David Jobst

Examples

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


jobstdavid/eppverification documentation built on May 13, 2024, 5:20 p.m.