resampling_cases {triptych} | R Documentation |
Bootstrap case resampling for triptych objects
Description
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 class 'triptych_murphy'
resampling_cases(x, level = 0.9, n_boot = 1000, ...)
## S3 method for class 'triptych_reliability'
resampling_cases(x, level = 0.9, n_boot = 1000, ...)
## S3 method for class '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 |
n_boot |
The number of bootstrap samples. |
... |
Additional arguments passed to other methods. |
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.
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
.
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)