sensitivity.analysis¶
Sensitivity analysis.
SensitivityOutput
dataclass
¶
Output measurement for SensitivityAnalysis.
SensitivitySimulation
¶
Base class for sensitivity calculation.
The sensitivity simulation runs a model simulation under a given set of model changes and returns a dictionary of scalar outputs. This function is called repeatedly during the sensitivity calculation.
Initialize the simulation with model, selections, changes and outputs.
SensitivityAnalysis
¶
SensitivityAnalysis(
sensitivity_simulation,
parameters,
groups,
results_path,
seed=None,
n_cores=None,
cache_results=False,
)
Parent class for all sensitivity analysis.
Create a sensitivity analysis for given parameter ids.
Based on the results matrix the sensitivity is calculated.
num_samples
property
¶
Number of samples.
Requires that samples have been created. Assumes all groups have the same number of samples.
simulate_samples
¶
Simulate all samples in parallel.
:param cache_filename: Path to the cache path. :param cache: If True, cache the simulated samples.
calculate_sensitivity
¶
Calculate the sensitivity matrices.
samples_required
¶
Samples of a group, raises if the samples are not created yet.
results_required
¶
Results of a group, raises if the samples are not simulated yet.
read_cache
¶
Read cached data from the results path, None if not cached.
write_cache
¶
Write data to the cache file in the results path.