Learn R Programming

SeaVal (version 1.1.1)

rel_diag_vec: Reliability diagram from vectors of probabilities and observations

Description

The probabilities have to be rounded beforehand (see round_probs), because the diagram draws a point for each level of the probabilities. The diagram includes a histogram indicating the forecast relative frequency for each probability bin. The diagram shows the reliability curve and the diagonal for reference. Moreover, it shows a regression line fitted by weighted linear regression where the forecast relative frequencies are used as weights. A horizontal and vertical line indicate the frequency of observation = TRUE over the entire dataset.

Usage

rel_diag_vec(discrete_probs, obs, slope_only = FALSE)

Value

A gg object.

Arguments

discrete_probs

Vector of (rounded) probabilites.

obs

Vector of logical observations.

slope_only

logical. If set to TRUE, only the slope of the reliability curve is returned

Examples

Run this code
discrete_probs = seq(0,1,length.out = 5)
obs = c(FALSE,FALSE,TRUE,TRUE,TRUE)
pp = rel_diag_vec(discrete_probs,obs)
if(interactive()) plot(pp)


Run the code above in your browser using DataLab