reliagram {topmodels} | R Documentation |
Reliagram (extended reliability diagram) for assessing the reliability of a fitted probabilistic distributional forecast.
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, ...)
object |
an object from which an extended reliability diagram
can be extracted with |
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 |
flavor |
Should the rootogram be a |
breaks |
numeric vector passed on to |
quantiles |
numeric vector of quantile probabilities with values in [0,1] to calculate single
or several thresholds. Only used if |
thresholds |
numeric vector specifying both where to cut the observations into binary values
and at which values the predicted probabilities should be calculated ( |
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. |
TODO: (ML)
Br\”ocker J, Smith L (2007). “Increasing the Reliability of Reliability Diagrams”. Weather and Forecasting, 22(3), 651–661. doi:10.1175/WAF993.1.
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)