Sensitivity and uncertainty#

One-variable sweeps and independently sampled uniform-input uncertainty experiments.

x2power.utilities.experiments.set_parameter(config, path, value)[source]#

Set an existing numeric leaf using a dotted path; never create silent typos.

Parameters:
  • config (dict[str, Any])

  • path (str)

  • value (float)

Return type:

None

x2power.utilities.experiments.sweep_parameter(scenario, path, values)[source]#
Parameters:
  • scenario (Mapping[str, Any])

  • path (str)

  • values (Sequence[float])

Return type:

list[dict[str, float]]

x2power.utilities.experiments.percentile(values, probability)[source]#
Parameters:
  • values (Sequence[float])

  • probability (float)

Return type:

float

x2power.utilities.experiments.monte_carlo(scenario, bounds, *, samples=1000, seed=0)[source]#

Sample uniform independent bounds. Invalid physical samples fail loudly.

Returned quantiles describe the chosen input assumptions, not calibrated confidence. Draws and net outputs are retained for reproducibility and inspection.

Parameters:
  • scenario (Mapping[str, Any])

  • bounds (Mapping[str, tuple[float, float]])

  • samples (int)

  • seed (int)

Return type:

dict[str, Any]