Skip to contents

Build a complete data frame of uncertainty parameters for a given case, populated with default bounds and variation types.

Usage

prepare_uncertainty(case, uncertainty = NULL)

Arguments

case

An object of class Case.

uncertainty

A data.frame of uncertainty parameters, or NULL (default). If NULL, the uncertainty slot of case is used if available.

Value

A data.frame with columns parameter, min, max, and type.

Details

The function constructs the full data.frame of uncertainty parameters, generating parameters for:

  • investment and maintenance costs per action (cost_investment_<action>, cost_maintenance_<action>),

  • flood events: return periods (period_<flood>) and hydraulic efficiency (hydraulic_<flood>),

  • direct damages per stake (stake_<stake>).

Return period uncertainty ranges (period_<flood>) are guaranteed not to overlap (consecutive overlapping ranges are adjusted to their midpoint via prepare_flood_range()) and are expressed in absolute values (type = "absolute").

Default bounds (min, max) and variation types (type) are retrieved from getOption("floodam.cba")[["uncertainty_default"]].

If an uncertainty table is supplied (or already present in the uncertainty slot of case), its values are preserved and override default values for matching parameters.

Author

Frédéric Grelot, frederic.grelot.1994_cran@m4x.org

Examples

case_simple = import_case(
    system.file("extdata", "case", "simple.ods", package = "floodam.cba")
)
#> import Case from /tmp/RtmpvMoJJK/temp_libpath2b69f6f14b9e9/floodam.cba/extdata/case/simple.ods
#>  ... done
prepare_uncertainty(case_simple)
#>                        parameter   min   max     type
#> 1    cost_investment_dam_raising   0.0   0.5 relative
#> 2   cost_investment_dyke_raising   0.0   0.5 relative
#> 3        cost_investment_nothing   0.0   0.5 relative
#> 4   cost_maintenance_dam_raising   0.0   0.5 relative
#> 5  cost_maintenance_dyke_raising   0.0   0.5 relative
#> 6       cost_maintenance_nothing   0.0   0.5 relative
#> 7               period_flood_min   3.5   6.5 absolute
#> 8                 period_flood_A  21.0  37.0 absolute
#> 9                 period_flood_B  37.0  65.0 absolute
#> 10                period_flood_C  70.0 130.0 absolute
#> 11              period_flood_max 175.0 325.0 absolute
#> 12           hydraulic_flood_min  -0.3   0.3 relative
#> 13             hydraulic_flood_A  -0.3   0.3 relative
#> 14             hydraulic_flood_B  -0.3   0.3 relative
#> 15             hydraulic_flood_C  -0.3   0.3 relative
#> 16           hydraulic_flood_max  -0.3   0.3 relative
#> 17                stake_activity  -0.5   0.5 relative
#> 18             stake_agriculture  -0.5   0.5 relative
#> 19                stake_dwelling  -0.5   0.5 relative
#> 20                  stake_public  -0.5   0.5 relative