swiftemulator.sensitivity.basic module

Basic sensitivity analysis based purely on the model values at consistent values in the space. No emulation is used to determine the sensitivity.

A different sensitivity analysis is ran for each dependent variable, so it is important to ensure that the functions are evaluated at consistent values.

swiftemulator.sensitivity.basic.binwise_sensitivity(specification: swiftemulator.backend.model_specification.ModelSpecification, parameters: swiftemulator.backend.model_parameters.ModelParameters, values: swiftemulator.backend.model_values.ModelValues) Dict[str, numpy.array][source]

Creates a binwise sensitivity analysis dictionary.

For each bin in dependent variable a hash is created; these are the keys in the returned dictionary.

Parameters
  • specification (ModelSpecification) – Model spec; parameter limits must be valid as these feed into the sensitivity analysis.

  • parameters (ModelParameters) – Parameters; these feed in as the independent variables in the sensitivity analysis.

  • values (ModelValues) – Dependent variables in the sensitivity analysis.

Returns

sensitivity – Binwise sensitivity analysis, with each array corresponding to the parameters in the order as specified by the specification. This is the “S1” vector from the RBD FAST method.

Return type

Dict[str, np.array]

swiftemulator.sensitivity.basic.plot_binwise_sensitivity(specification: swiftemulator.backend.model_specification.ModelSpecification, sensitivities: Dict[str, numpy.array], figure: Optional[matplotlib.figure.Figure] = None, axes: Optional[matplotlib.axes._axes.Axes] = None, xlabel: Optional[str] = None, ylabel: Optional[str] = None, cbarlabel: Optional[str] = None, cmap: Optional[Union[str, matplotlib.cm.ScalarMappable]] = None, vmin: float = - 0.25, vmax: float = 0.25) Tuple[matplotlib.figure.Figure, matplotlib.axes._axes.Axes][source]

Create a figure and axis displaying the output of the sensitivity analysis.