Autonomy-level trade-off (AL0-AL5)

R-CMD-check pkgdown Codecov test coverage License: MIT Lifecycle: experimental

library(dynasimR)
sim <- load_example_data()

AL-Efficiency ratio

We trade off event-rate reduction versus the Compliance Index. The default AL scenario mapping requires the full sweep; here we demonstrate with the two AL points in the shipped example data.

al <- al_efficiency(
  sim,
  al_scenarios         = c("0" = "A-S00", "1" = "A-S01"),
  compliance_threshold = 0.80,
  n_bootstrap          = 200
)
al$tradeoff_table
#> # A tibble: 2 × 12
#>      al scenario event_median event_ci_lo event_ci_hi event_reduction_pct
#>   <int> <chr>           <dbl>       <dbl>       <dbl>               <dbl>
#> 1     0 A-S00           0.341       0.328       0.353                0   
#> 2     1 A-S01           0.272       0.260       0.289                6.91
#> # ℹ 6 more variables: event_reduction_ci_lo <dbl>, event_reduction_ci_hi <dbl>,
#> #   compliance <dbl>, above_threshold <lgl>, al_ratio <dbl>, n_reps <int>

Trade-off plot

plot_al_tradeoff(al)

Interpretation

The optimal_al slot holds the AL level with the highest event-rate reduction while staying above the compliance threshold:

al$optimal_al
#> [1] 1

Compliance violations (if any):

al$compliance_violations
#> # A tibble: 1 × 13
#>      al scenario event_median event_ci_lo event_ci_hi event_reduction_pct
#>   <int> <chr>           <dbl>       <dbl>       <dbl>               <dbl>
#> 1     0 A-S00           0.341       0.328       0.353                   0
#> # ℹ 7 more variables: event_reduction_ci_lo <dbl>, event_reduction_ci_hi <dbl>,
#> #   compliance <dbl>, above_threshold <lgl>, al_ratio <dbl>, n_reps <int>,
#> #   compliance_deficit <dbl>