Skip to contents

floodam.cba 1.3.0.0

Release date: 2026-11-16

Enhancements

  • calculate_weight() (export)
    • add fast vectorized matrix path when margin = 1 and rows share a common frequency order without NA
  • calculate_weight_vector() (internal)
    • manage NA values
  • Case (class & constructor)
    • add slot uncertainty (data.frame_NULL)
    • constructor Case() automatically initializes and validates uncertainty, and stores case study name in characteristic[["name"]] (accessible via case["name"])
    • method characterize() adds action, flood, stake_dam, stake_com and period (matrix of return periods per sector and flood, including “global”)
    • accessor [ supports period, flood, and stake_dam
    • validation method refactored into modular check functions (check_case_*)
  • check_case_action() (new internal)
    • check expected columns in slot ‘action’ and consistency of actions with slot ‘project’
  • check_case_event() (new internal)
    • verify that ‘base’ and ‘change’ projects in slot ‘event’ are declared in slot ‘project’
  • check_case_project() (new internal)
    • check expected columns in slot ‘project’
  • check_case_sector() (new internal)
    • verify that all elements in slot ‘sector’ are of class ‘Sector’
  • check_case_uncertainty() (new internal)
    • check expected columns, presence of all required parameters, min <= max, and admissible types in slot ‘uncertainty’
  • check_column() (new internal)
    • new helper to check missing and extra columns
  • draw_parameter() (new internal)
    • draw random parameter values from uniform distributions with relative or absolute bounds
  • format_aad() (new internal)
    • compute average annual damage by state and stake with optional state filtering
  • format_aadd() (new internal)
    • compute avoided average annual damage relative to project initial state
  • format_flood() (new export)
    • format return periods and calculate integration weights, with global summary for multiple sectors
  • format_impact() (new internal)
    • compute nominal avoided damages by flood event and by stake between project initial and final states
  • format_sector() (new export)
    • flatten multi-dimensional theme arrays into 2D tables, with stake totals and global multi-sector aggregation
  • get_label() (new internal)
    • retrieve multilingual graphical labels from label_graphic with automatic fallback to English ("en")
  • import_case() (export)
    • manage uncertainty sheet and pass file basename (without extension) as name to Case()
  • perform_sa() (new export)
    • perform in-memory Monte Carlo uncertainty analysis and global Sobol sensitivity analysis for both npv and benefit, returning an object of class "cba_uncertainty"
  • plot.cba_uncertainty() (new export)
    • S3 plot() method for objects of class "cba_uncertainty", delegating to plot_sa()
  • plot_calendar_state() (new export)
    • display stacked barplot of annual state weights (simple or probabilistic calendar) for a Case project with multilingual labels and device support
  • plot_sa() (new export)
    • main wrapper function to display uncertainty distributions, Sobol sensitivity indices, combined 2x1 panels, or 2x2 triplet interaction matrices
  • plot_sa_triplet() (new export)
    • display a 2x2 visual diagnostic of the 3 most influential parameters on npv or benefit
  • plot_sobol() (new export)
    • display horizontal barplots of first-order (S) and/or total-order (T) Sobol sensitivity indices with bootstrap confidence intervals
  • plot_uncertainty() (new export)
    • display empirical distribution (histogram and/or density) of npv or benefit with nominal reference and negative threshold
  • prepare_flood_range() (new internal)
    • adjust flood uncertainty ranges in absolute values, cutting at midpoint in case of overlap
  • prepare_period() (new internal)
    • build the matrix of return periods across sectors and floods
  • prepare_sa() (new export)
    • assemble all structured input components (calendar, cost, flood, impact) and metadata for sensitivity analysis
  • prepare_sa_calendar() (new export)
    • merge annual normalized benefit activation and cost disbursement schedules
  • prepare_sa_calendar_benefit() (new internal)
    • compute normalized benefit activation schedule [0, 1] from project state sequence and avoided damages
  • prepare_sa_calendar_cost() (new internal)
    • compute annual normalized cost disbursement schedules for investment and maintenance per action
  • prepare_sa_cost() (new export)
    • extract nominal investment and maintenance costs per action paired with uncertainty bounds
  • prepare_sa_flood() (new export)
    • prepare table of flood hazard parameters (nominal and bounds for return periods and hydraulic efficiency)
  • prepare_sa_impact() (new export)
    • compute nominal avoided damages by flood event and by stake paired with stake uncertainty bounds
  • prepare_uncertainty() (new export)
    • new function to generate the complete data.frame of uncertainty parameters for a Case (costs, return periods, hydraulic efficiency, damages) with default fallback and user override
  • prop_negative() (new export)
    • compute proportion of non-positive indicator values across parameter intervals
  • read_from_ext() (internal)
    • do not show progress while reading ods files (progress = FALSE)
  • sa_calculate_nominal() (new internal)
    • compute deterministic baseline parameters and CBA indicators for sensitivity analysis
  • sa_draw_parameter() (new internal)
    • generate Monte Carlo sample matrix of all uncertain parameters prefixed with nominal values
  • sa_fit_impact() (new internal)
    • scale baseline avoided damages by stake and hydraulic efficiency multipliers
  • sa_model() (new internal)
    • vectorized evaluation of avoided damages, expected annual benefit, and net present value
  • sa_set_impact_base() (new internal)
    • extract and flatten nominal avoided damages per stake and flood scenario
  • with_device() (new internal)
    • open and automatically close graphical output devices (active, pdf, png, jpg, jpeg, svg) in dir_output using standardized filename <case>-<project>-<graphic>-<lang>.<ext>

Data & Options

  • data_specification
    • add specification for uncertainty table (parameter, min, max, type)
  • label_graphic (new dataset)
    • hierarchical dictionary of multilingual graphical labels (en, fr, es, it, de, pt, zh, ja, ru, ar, hi) generated from data-raw/label_graphic.yml
  • options("floodam.cba")
    • add options for uncertainty: uncertainty_col, uncertainty_type_admissible, uncertainty_default, sobol_method, n_uncertainty, and n_boot

Dependencies

  • Add sensitivity, graphics, grDevices, stats, tools and utils to Imports, and yaml to Suggests

Documentation

floodam.cba 1.2.0.0

Release date: 2026-10-30

Enhancements

  • discount_rate()
    • add official as default option.
    • constant is set to “0.025” (last official recommendation)
  • Case()
    • method characterize set rate to getOption("floodam.cba")[["rate"]]

Data

  • getOption("floodam.cba")[["rate"]] returns “official”

Documentation

floodam.cba 1.1.1.0

Release date: 2025-10-29

Enhancements

  • diff_calendar() (internal)
    • take into account new format for probabilistic calendar
  • print.log_msg() (export)
    • explicit export to allow its use as a print() method for object of class “log_msg”

floodam.cba 1.1.0.0

Release date: 2025-10-27

Enhancements

  • calculate_weight() (export)
    • management of formats to makes appropriate calls to calculate_weight_vector
    • management of data.frame and arrays (correctly)
    • documentation and tests
  • calculate_weight_vector() (internal)
    • type can be chosen between “period” (default) and “frequency”
    • management of flood scenarios in any order
  • discount_rate() (export)
    • add of option quinet2013, option constant is default, option cgp is re-named in cgp 2005
    • documentation
  • discount_weight()
    • documentation
  • list_to_array()
    • optional test to have a message is something goes wrong
    • examples to the documentation, and tests

Bugs

floodam.cba 1.0.0.0

First version