Description Usage Arguments Details Value References Examples
Wrapper around 'pit()' for use in data.frames
1 2 3 4 5 6 7 8 |
data |
a data.frame with the following columns: 'true_value', 'prediction', 'sample' |
plot |
logical. If TRUE, a histogram of the PIT values will be returned as well |
full_output |
return all individual p_values and computed u_t values for the randomised PIT. Usually not needed. |
n_replicates |
the number of tests to perform, each time re-randomising the PIT |
num_bins |
the number of bins in the PIT histogram (if plot == TRUE) If not given, the square root of n will be used |
verbose |
if TRUE (default is FALSE) more error messages are printed. Usually, this should not be needed, but may help with debugging. |
see pit
a list with the following components:
p_value
: p-value of the Anderson-Darling test on the
PIT values. In case of integer forecasts, this will be the mean p_value
from the 'n_replicates' replicates
sd
: standard deviation of the p_value returned. In case of
continuous forecasts, this will be NA as there is only one p_value returned.
hist_PIT
a plot object with the PIT histogram. Only returned
if plot == TRUE
. Call
plot(PIT(...)$hist_PIT)
to display the histogram.
p_values
: all p_values generated from the Anderson-Darling tests on the
randomised PIT. Only returned for integer forecasts
and if full_output = TRUE
u
: the u_t values internally computed. Only returned if
full_output = TRUE
Sebastian Funk, Anton Camacho, Adam J. Kucharski, Rachel Lowe, Rosalind M. Eggo, W. John Edmunds (2019) Assessing the performance of real-time epidemic forecasts: A case study of Ebola in the Western Area region of Sierra Leone, 2014-15, <doi:10.1371/journal.pcbi.1006785>
1 2 | example <- scoringutils2::continuous_example_data
result <- pit_df(example, full_output = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.