Bootstrap case resampling for triptych objects
Source:R/resampling.R
, R/triptych_murphy.R
, R/triptych_reliability.R
, and 1 more
resampling_cases.Rd
This function is intended to be called from add_confidence()
,
by specifying "resampling_cases"
in the method
argument.
Usage
resampling_cases(x, level = 0.9, n_boot = 1000, ...)
# S3 method for triptych_murphy
resampling_cases(x, level = 0.9, n_boot = 1000, ...)
# S3 method for triptych_reliability
resampling_cases(x, level = 0.9, n_boot = 1000, ...)
# S3 method for triptych_roc
resampling_cases(x, level = 0.9, n_boot = 1000, ...)
Arguments
- x
One of the triptych objects.
- level
A single value that determines which quantiles of the bootstrap sample to return. These quantiles envelop
level * n_boot
bootstrap draws.- n_boot
The number of bootstrap samples.
- ...
Additional arguments passed to other methods.
Value
A list of tibbles that contain the information to draw confidence regions.
The length is equal to the number of forecasting methods in x
.
Details
Case resampling assumes independent and identically distributed forecast-observation pairs. A given number of bootstrap samples are the basis for pointwise computed confidence intervals. For every bootstrap sample, we draw forecast-observations pairs with replacement until the size of the original data set is reached.
Examples
data(ex_binary, package = "triptych")
# Bootstrap resampling is expensive
# (the number of bootstrap samples is small to keep execution times short)
tr <- triptych(ex_binary) |>
dplyr::slice(1, 9) |>
add_confidence(level = 0.9, method = "resampling_cases", n_boot = 20)