reliagram {topmodels}R Documentation

Reliagram (Extended Reliability Diagram)

Description

Reliagram (extended reliability diagram) for assessing the reliability of a fitted probabilistic distributional forecast.

Usage

reliagram(object, ...)

## Default S3 method:
reliagram(object, newdata = NULL, plot = TRUE, flavor = NULL,
  breaks = seq(0, 1, by = 0.1), quantiles = 0.5, thresholds = NULL,
  confint = TRUE, confint_level = 0.95, confint_nboot = 250,
  confint_seed = 1, single_graph = FALSE, xlab = "Forecast probability", 
  ylab = "Observed relative frequency", main = NULL, ...) 

Arguments

object

an object from which an extended reliability diagram can be extracted with procast.

newdata

optionally, a data frame in which to look for variables with which to predict. If omitted, the original observations are used.

plot

logical. Should the plot method be called to draw the computed extended reliability diagram?

flavor

Should the rootogram be a base or ggplot2 style graphic, accordingly the invisible return value is either a data.frame or a tibble. Either set flavor expicitly to "base" vs. "tidyverse", or it's chosen automatically conditional if the packages ggplot2 and dplyr or tibble are loaded.

breaks

numeric vector passed on to cut in order to bin the observations and the predicted probabilities or a function applied to the predicted probabilities to calculate a numeric value for cut. Typically quantiles to ensure equal number of predictions per bin, e.g., by breaks = function(x) quantile(x).

quantiles

numeric vector of quantile probabilities with values in [0,1] to calculate single or several thresholds. Only used if thresholds is not specified. For binary responses typically the 50%-quantile is used.

thresholds

numeric vector specifying both where to cut the observations into binary values and at which values the predicted probabilities should be calculated (procast).

confint

logical. Should confident intervals be calculated and drawn?

confint_level

numeric. The confidence level required.

confint_nboot

numeric. The number of bootstrap steps.

confint_seed

numeric. The seed to be set for the bootstrapping.

single_graph

logical. Should all computed extended reliability diagrams be plotted in a single graph?

xlab, ylab, main

graphical parameters.

...

further graphical parameters.

Details

TODO: (ML)

References

Br\”ocker J, Smith L (2007). “Increasing the Reliability of Reliability Diagrams”. Weather and Forecasting, 22(3), 651–661. doi:10.1175/WAF993.1.

See Also

procast

Examples

require("crch")
m1 <- lm(dist ~ speed, data = cars)
m2 <- crch(dist ~ speed | speed, data = cars)
m3 <- crch(dist ~ speed | speed, left = 30, data = cars)

rel1 <- reliagram(m1, quantiles = c(0.2, 0.6))
rel2 <- reliagram(m2, plot = FALSE)
rel3 <- reliagram(m3, plot = FALSE)

plot(c(rel1, rel2), single_graph = TRUE, col = c(1, 2, 3), lty = c(1, 2, 3), pch = c(1, 2, 3))

plot(rel1, single_graph = TRUE, col = c(1, 2), fill = c(1, 2))
lines(rel3, col = 3, lty = 2, confint = 3)

[Package topmodels version 0.1-0 Index]