Skip to contents

Consistency regions are created under the assumption that the forecasts are calibrated. A reliability curve that significantly violates the consistency region indicates a miscalibrated forecast.

Usage

add_consistency(x, level = 0.9, method = "resampling_Bernoulli", ...)

Arguments

x

An object to which a consistency region should be added.

level

A single value for the level of confidence.

method

A string that gives the name of method to generate the consistency regions. Currently, only: "resampling_Bernoulli".

...

Additional arguments passed to methods.

Value

The object given to x, but with information about the consistency regions. This information can be accessed conveniently by using regions() on the reliability curve component.

Examples

data(ex_binary, package = "triptych")

tr <- triptych(ex_binary) |>
  dplyr::slice(1, 9)

# Bootstrap resampling is expensive
# (the number of bootstrap samples is small to keep execution times short)

tr <- add_consistency(tr, level = 0.9, method = "resampling_Bernoulli", n_boot = 20)
regions(tr$reliability)
#> # A tibble: 1,998 × 6
#>    forecast        x lower upper method                  level
#>    <chr>       <dbl> <dbl> <dbl> <chr>                   <dbl>
#>  1 X01      1.19e-23     0     0 resampling_Bernoulli_20   0.9
#>  2 X01      3.84e-23     0     0 resampling_Bernoulli_20   0.9
#>  3 X01      9.45e-22     0     0 resampling_Bernoulli_20   0.9
#>  4 X01      9.82e-20     0     0 resampling_Bernoulli_20   0.9
#>  5 X01      1.13e-19     0     0 resampling_Bernoulli_20   0.9
#>  6 X01      4.73e-17     0     0 resampling_Bernoulli_20   0.9
#>  7 X01      1.40e-16     0     0 resampling_Bernoulli_20   0.9
#>  8 X01      6.33e-16     0     0 resampling_Bernoulli_20   0.9
#>  9 X01      1.48e-15     0     0 resampling_Bernoulli_20   0.9
#> 10 X01      7.97e-15     0     0 resampling_Bernoulli_20   0.9
#> # ℹ 1,988 more rows