Skip to contents

Note

Une version française de cet article est disponible : Options du package.

Inspecting and modifying options

When floodam.cba is loaded, it initializes two R options:

  • floodam.cba.verbose: logical scalar (default TRUE) controlling whether informational messages are printed to the console;
  • floodam.cba: a named list grouping all default parameters used across data import, CBA calculation, and uncertainty/sensitivity analysis.

You can inspect the current configuration at any time with getOption():

names(getOption("floodam.cba"))
#>  [1] "stake_dam_admissible"        "stake_com_admissible"       
#>  [3] "stake_evo_admissible"        "stake_dam_mandatory"        
#>  [5] "stake_com_mandatory"         "stake_dam_typology"         
#>  [7] "stake_com_typology"          "project_col"                
#>  [9] "action_col"                  "cost_during"                
#> [11] "cost_after"                  "flood_dim"                  
#> [13] "event_dim"                   "scenario_dim"               
#> [15] "damage_dim"                  "complement_dim"             
#> [17] "evolution_dim"               "uncertainty_col"            
#> [19] "uncertainty_type_admissible" "uncertainty_default"        
#> [21] "horizon_start"               "horizon_end"                
#> [23] "rate"                        "reference"                  
#> [25] "sobol_method"                "n_uncertainty"              
#> [27] "n_boot"

To customize one or more options without overwriting the rest of the list, update a copy of getOption("floodam.cba") and pass it back to options():

opts = getOption("floodam.cba")
opts[["n_uncertainty"]] = 5000L
opts[["n_boot"]] = 200L
options(floodam.cba = opts)

For the full reference list of all options, see ?floodam.cba-options.

General and discounting options

These options govern the default temporal scope and counterfactual baseline:

  • horizon_start (default 0): initial year of the analysis horizon;
  • horizon_end (default 50): final year of the analysis horizon;
  • rate (default "official"): discount rate scheme used by discount_rate() (e.g. "official", "constant", "quinet2013", "cgp2005");
  • reference (default "baseline"): name of the counterfactual reference project used to compute avoided damages and CBA indicators.
str(getOption("floodam.cba")[c(
  "horizon_start", "horizon_end", "rate", "reference"
)])
#> List of 4
#>  $ horizon_start: num 0
#>  $ horizon_end  : num 50
#>  $ rate         : chr "official"
#>  $ reference    : chr "baseline"

Uncertainty and sensitivity analysis options

These options control prepare_uncertainty(), prepare_sa(), and perform_sa():

  • n_uncertainty (default 1000): default base Monte Carlo sample size used by prepare_sa() and perform_sa(). Increasing n_uncertainty improves the precision of empirical quantiles and Sobol indices (at the cost of (p+2)×n(p + 2) \times n model evaluations);
  • n_boot (default 100): default number of bootstrap replicates used by sensitivity::sobolmartinez to estimate confidence intervals on Sobol indices;
  • sobol_method (default "sobolmartinez"): sensitivity estimation function from the sensitivity package;
  • uncertainty_default: default uncertainty ranges applied automatically by prepare_uncertainty() when no custom uncertainty sheet is provided:
    • cost: min = 0, max = 0.5, type = "relative" (0% to +50% on costs);
    • flood: min = -0.3, max = 0.3, type = "relative" (±30%\pm 30\% on return periods, automatically truncated to prevent overlap);
    • hydraulic: min = -0.3, max = 0.3, type = "relative" (±30%\pm 30\% on hydraulic efficiency);
    • stake_dam: min = -0.5, max = 0.5, type = "relative" (±50%\pm 50\% on damage estimations);
  • uncertainty_col and uncertainty_type_admissible: expected columns (c("parameter", "min", "max", "type")) and admissible variation types (c("relative", "absolute")) validated during Case import.
str(getOption("floodam.cba")[c(
  "n_uncertainty", "n_boot", "sobol_method", "uncertainty_default"
)])
#> List of 4
#>  $ n_uncertainty      : num 10000
#>  $ n_boot             : num 100
#>  $ sobol_method       : chr "sobolmartinez"
#>  $ uncertainty_default:List of 4
#>   ..$ cost     :List of 3
#>   .. ..$ min : num 0
#>   .. ..$ max : num 0.5
#>   .. ..$ type: chr "relative"
#>   ..$ flood    :List of 3
#>   .. ..$ min : num -0.3
#>   .. ..$ max : num 0.3
#>   .. ..$ type: chr "relative"
#>   ..$ hydraulic:List of 3
#>   .. ..$ min : num -0.3
#>   .. ..$ max : num 0.3
#>   .. ..$ type: chr "relative"
#>   ..$ stake_dam:List of 3
#>   .. ..$ min : num -0.5
#>   .. ..$ max : num 0.5
#>   .. ..$ type: chr "relative"

Stakes, typologies, and input schemas

The remaining entries in getOption("floodam.cba") define the domain rules enforced by import_case() and Case validation:

  • Stakes and typologies:
    • stake_dam_admissible, stake_dam_mandatory, stake_dam_typology: admissible and mandatory direct damage stakes (e.g. "activity", "agriculture", "dwelling", "public") and their grouping into "urban", "rural", and "other";
    • stake_com_admissible, stake_com_mandatory, stake_com_typology: admissible and mandatory complementary stakes (e.g. "inhabitant", "employee");
    • stake_evo_admissible: admissible temporal evolution categories (c("urban", "rural", "other")).
  • Expected columns and dimensions:
    • project_col, action_col, cost_during, cost_after: expected column names and cost categories in project and action tables;
    • flood_dim, event_dim, scenario_dim, damage_dim, complement_dim, evolution_dim: dimension names used to structure multi-dimensional Sector arrays.