plot_pit {scoringutils} | R Documentation |
PIT Histogram
Description
Make a simple histogram of the probability integral transformed values to visually check whether a uniform distribution seems likely.
Usage
plot_pit(pit, num_bins = "auto", breaks = NULL)
Arguments
pit |
either a vector with the PIT values of size n, or a data.frame as
produced by |
num_bins |
the number of bins in the PIT histogram, default is "auto".
When |
breaks |
numeric vector with the break points for the bins in the
PIT histogram. This is preferred when creating a PIT histogram based on
quantile-based data. Default is |
Value
vector with the scoring values
Examples
# PIT histogram in vector based format
true_values <- rnorm(30, mean = 1:30)
predictions <- replicate(200, rnorm(n = 30, mean = 1:30))
pit <- pit_sample(true_values, predictions)
plot_pit(pit)
# quantile-based pit
pit <- pit(example_quantile,by = "model")
plot_pit(pit, breaks = seq(0.1, 1, 0.1))
# sample-based pit
pit <- pit(example_integer,by = "model")
plot_pit(pit)