View source: R/pairwise-comparisons.R
pairwise_comparison | R Documentation |
Make pairwise comparisons between models. The code for the pairwise comparisons is inspired by an implementation by Johannes Bracher.
The implementation of the permutation test follows the function
permutationTest
from the surveillance
package by Michael Höhle,
Andrea Riebler and Michaela Paul.
pairwise_comparison( scores, by = c("model"), metric = "auto", baseline = NULL, ... )
scores |
A data.table of scores as produced by |
by |
character vector with names of columns present in the input
data.frame. |
metric |
A character vector of length one with the metric to do the
comparison on. The default is "auto", meaning that either "interval_score",
"crps", or "brier_score" will be selected where available.
See |
baseline |
character vector of length one that denotes the baseline model against which to compare other models. |
... |
additional arguments for the comparison between two models. See
|
A ggplot2 object with a coloured table of summarised scores
Nikos Bosse nikosbosse@gmail.com
Johannes Bracher, johannes.bracher@kit.edu
df <- data.frame( model = rep(c("model1", "model2", "model3"), each = 10), date = as.Date("2020-01-01") + rep(1:5, each = 2), location = c(1, 2), interval_score = (abs(rnorm(30))), ae_median = (abs(rnorm(30))) ) res <- pairwise_comparison(df, baseline = "model1" ) plot_pairwise_comparison(res) eval <- score(example_quantile) pairwise_comparison(eval, by = c("model"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.