plot_pit | R Documentation |
Make a simple histogram of the probability integral transformed values to visually check whether a uniform distribution seems likely.
plot_pit(pit, num_bins = "auto", breaks = NULL)
pit |
Either a vector with the PIT values, or a data.table 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 |
A ggplot object with a histogram of PIT values
# PIT histogram in vector based format
observed <- rnorm(30, mean = 1:30)
predicted <- replicate(200, rnorm(n = 30, mean = 1:30))
pit <- pit_sample(observed, predicted)
plot_pit(pit)
# quantile-based pit
pit <- get_pit(as_forecast(example_quantile), by = "model")
plot_pit(pit, breaks = seq(0.1, 1, 0.1))
# sample-based pit
pit <- get_pit(as_forecast(example_sample_discrete), by = "model")
plot_pit(pit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.