Given a quantitative scenario object of type tidyrisk_scenario, run an OpenFAIR Monte Carlo simulation.

run_simulation(
  scenario,
  iterations = 10000L,
  ale_maximum = NULL,
  verbose = FALSE,
  simulation_count = NULL
)

Arguments

scenario

A tidyrisk_scenario object.

iterations

Number of iterations to run on each scenario.

ale_maximum

Maximum practical annual losses.

verbose

Whether verbose console output is requested.

simulation_count

DEPRECATED Number of simulations to perform.

Value

Dataframe of results.

Examples

data(mc_quantitative_scenarios)
run_simulation(mc_quantitative_scenarios$scenario[[1]], 10)
#> # A tibble: 10 × 11
#>    iteration threat_events loss_events  vuln mean_tc_exceedance mean_diff_excee…
#>        <int>         <int>       <int> <dbl>              <dbl>            <dbl>
#>  1         1            30           5 0.167             0.0463           0.0690
#>  2         2            30          11 0.367             0.0323           0.0723
#>  3         3            23           7 0.304             0.0249           0.0842
#>  4         4            19          11 0.579             0.0330           0.0604
#>  5         5            24           4 0.167             0.0281           0.0759
#>  6         6            36          14 0.389             0.0255           0.0633
#>  7         7            32           7 0.219             0.0405           0.0580
#>  8         8            31           8 0.258             0.0210           0.0711
#>  9         9            41          11 0.268             0.0299           0.0660
#> 10        10            20           4 0.2               0.0459           0.0855
#> # … with 5 more variables: ale <dbl>, sle_mean <dbl>, sle_median <dbl>,
#> #   sle_max <dbl>, sle_min <dbl>