Skip to contents

Accessing confidence/consistency region data

Usage

regions(x, ...)

# S3 method for triptych_mcbdsc
regions(x, ...)

# S3 method for triptych_murphy
regions(x, ...)

# S3 method for triptych_reliability
regions(x, ...)

# S3 method for triptych_roc
regions(x, ...)

Arguments

x

An object from which the region information should be extracted.

...

Additional arguments passed to other methods.

Value

A tibble with the relevant information for the uncertainty quantification of the chosen diagnostic (Murphy curve, reliability curve, ROC curve, score decomposition) for all supplied forecasting methods.

For a Murphy curve, a tibble with columns: forecast, threshold, lower, upper, method, level.

For a reliability curve, a tibble with columns: forecast, x (forecast values), lower, upper, method, level.

For a ROC curve, a tibble with columns: forecast, FAR (false alarm rate), HR (hit rate), method, level. This tibble is twice as long as those for Murphy and reliability curves, since the FAR-HR pairs are ordered to describe a polygon, generated by pointwise confidence intervals along diagonal lines with slope \(-\pi_0/\pi_1\). Here, \(\pi_1 = 1 - \pi_0\) is the unconditional event probability.

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)

regions(tr$murphy)
#> # A tibble: 2,000 × 6
#>    forecast threshold    lower    upper method              level
#>    <chr>        <dbl>    <dbl>    <dbl> <chr>               <dbl>
#>  1 X01        0       0        0        resampling_cases_20   0.9
#>  2 X01        0.00100 0.000605 0.000731 resampling_cases_20   0.9
#>  3 X01        0.00200 0.00116  0.00140  resampling_cases_20   0.9
#>  4 X01        0.00300 0.00169  0.00201  resampling_cases_20   0.9
#>  5 X01        0.00400 0.00222  0.00261  resampling_cases_20   0.9
#>  6 X01        0.00501 0.00271  0.00321  resampling_cases_20   0.9
#>  7 X01        0.00601 0.00318  0.00381  resampling_cases_20   0.9
#>  8 X01        0.00701 0.00359  0.00436  resampling_cases_20   0.9
#>  9 X01        0.00801 0.00400  0.00492  resampling_cases_20   0.9
#> 10 X01        0.00901 0.00450  0.00550  resampling_cases_20   0.9
#> # ℹ 1,990 more rows
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_cases_20   0.9
#>  2 X01      3.84e-23     0     0 resampling_cases_20   0.9
#>  3 X01      9.45e-22     0     0 resampling_cases_20   0.9
#>  4 X01      9.82e-20     0     0 resampling_cases_20   0.9
#>  5 X01      1.13e-19     0     0 resampling_cases_20   0.9
#>  6 X01      4.73e-17     0     0 resampling_cases_20   0.9
#>  7 X01      1.40e-16     0     0 resampling_cases_20   0.9
#>  8 X01      6.33e-16     0     0 resampling_cases_20   0.9
#>  9 X01      1.48e-15     0     0 resampling_cases_20   0.9
#> 10 X01      7.97e-15     0     0 resampling_cases_20   0.9
#> # ℹ 1,988 more rows
regions(tr$roc)
#> # A tibble: 4,004 × 5
#>    forecast   FAR      HR method              level
#>    <chr>    <dbl>   <dbl> <chr>               <dbl>
#>  1 X01          0 0       resampling_cases_20   0.9
#>  2 X01          0 0.00209 resampling_cases_20   0.9
#>  3 X01          0 0.00418 resampling_cases_20   0.9
#>  4 X01          0 0.00628 resampling_cases_20   0.9
#>  5 X01          0 0.00837 resampling_cases_20   0.9
#>  6 X01          0 0.0105  resampling_cases_20   0.9
#>  7 X01          0 0.0126  resampling_cases_20   0.9
#>  8 X01          0 0.0146  resampling_cases_20   0.9
#>  9 X01          0 0.0167  resampling_cases_20   0.9
#> 10 X01          0 0.0188  resampling_cases_20   0.9
#> # ℹ 3,994 more rows