aquakin.compare_scenarios#

aquakin.compare_scenarios(fn, scenarios, *, input_names, baseline=None, output_names=None, batched=True)[source]#

Run fn under several named scenarios and tabulate the outputs.

Parameters:
  • fn (callable) – fn(x) -> output as in monte_carlo() / aquakin.dgsm().

  • scenarios (dict) – name -> overrides where overrides is either a full input vector (length d) or a mapping {input_name: value} applied on top of baseline (so a scenario only states what it changes). An empty mapping {} is the baseline itself.

  • input_names (sequence of str) – Names of the d inputs (defines the vector order and the override keys).

  • baseline (sequence of float, optional) – The nominal input vector that mapping-style overrides modify. Required if any scenario uses {input_name: value} overrides; defaults to zeros.

  • output_names (sequence of str, optional) – Output column names.

  • batched (bool) – vmap the scenarios (default) or evaluate one at a time.

Return type:

ScenarioComparison