
Evaluate CBA model for a matrix of sensitivity analysis parameters
sa_model.RdVectorized CBA evaluation model computing avoided damages, expected annual benefit (EAD avoided), and net present value (NPV) for a matrix of sampled parameters.
Arguments
- x
A numeric matrix or data frame whose columns contain sampled parameter values (
cost_*,period_*,hydraulic_*,impact_*).- impact_base
A named numeric vector of baseline avoided damages per stake and flood scenario, as returned by
sa_set_impact_base().- calendar
A data frame representing the project's normalized calendar schedule, containing at least columns
year,benefit, and action cost schedules (as returned bysa_input[["calendar"]]).- rate
Discount rate specification (defaults to
getOption("floodam.cba")[["rate"]]).- indicator
Character scalar specifying the output format:
"complete"(default) returns parameters, damages, benefit, and npv;"npv"returns only the numeric vector of NPV values;"benefit"returns only the numeric vector of expected annual benefits.
Value
Depending on indicator:
If
"complete", an invisible numeric matrix combiningx, avoided damages per stake/scenario,benefit, andnpv.If
"npv", an invisible numeric vector of Net Present Values corresponding to each row ofx.If
"benefit", an invisible numeric vector of expected annual benefits corresponding to each row ofx.
Details
This function serves as the computational core for sensitivity and
uncertainty analysis, designed to be called directly or passed as the
model argument to functions from the sensitivity package.
Given a parameter matrix x where columns correspond to:
investment and maintenance costs (
cost_*),flood hazard return periods (
period_*),hydraulic efficiency (
hydraulic_*),damage multipliers (
impact_*),
the function executes the following steps for each row:
Avoided damages per stake and flood event are scaled via
sa_fit_impact()usingimpact_base.Integration weights across flood events are computed using
calculate_weight()from return periods.Expected annual benefit (EAD avoided) is computed by integrating avoided damages across flood probabilities via trapezoidal summation.
Annual discount weights are evaluated using
discount_weight()oncalendar[["year"]]with discountrate.Pre-discounted schedule coefficients are combined with benefits and costs to compute Net Present Value (
npv) through matrix multiplication.
Author
Frédéric Grelot, frederic.grelot.1994_cran@m4x.org