Sensitivity#

This module contains all sensitivity related functionality.

The entry point for performing a sensitivity analysis is probabilistic_library.project.SensitivityProject. A model can be attached to a sensitivity project, then stochastic variables, correlation matrix and settings are provided. When the sensitivity project is run, a sensitivity result is generated.

class SensitivityMethod(value)[source]#

Bases: Enum

Enumeration which defines the algorithm to perform a sensitivity analysis

single_variation = 'single_variation'#
sobol = 'sobol'#
class SensitivityResult(id)[source]#

Bases: FrozenObject

Contains the result of a sensitivity analysis for a specific output parameter

A sensitivity result contains values for each input variable, listed in ‘values’.

get_plot()[source]#

Gets a plot object of the sensitivity in the form of a bar-chart

Return type:

<module ‘matplotlib.pyplot’ from ‘/home/runner/.cache/pypoetry/virtualenvs/probabilistic-library-UeuwKTS6-py3.11/lib/python3.11/site-packages/matplotlib/pyplot.py’>

property identifier: str#

Identification of the output parameter

property messages: list[Message]#

List of messages generated by the reliability algorithm. Depends on the setting ‘save_messages’ whether this list is provided

plot()[source]#

Shows a plot of the sensitivity in the form of a bar-chart

print(decimals=4)[source]#

Prints the sensitivity result, including sensitivity values for each input variable.

Parameters:

decimals (int, optional.) – The number of decimals to print

property realizations: list[Evaluation]#

List of samples calculated by the reliability algorithm. Depends on the setting ‘save_realizations’ whether this list is provided

property values: list[SensitivityValue]#

List of sensitivity values per input variable. The values in this list contain the sensitivity results.

class SensitivitySettings[source]#

Bases: FrozenObject

Settings of a sensitivity algorithm

Settings of all sensitivity algorithms are combined in this class. Often settings only apply to a selected number of algorithms. Settings per variable are listed in stochast_settings.

The settings are divided into the following categories:

Algorithm settings: Settings which are used to control the algorithm, such as variations of the input values.

Runtime settings: Settings to control how model executions take place and which additional output to produce. These settings do not influence the calculated sensitivity.

property high_value: float#

The high value (defined as probability) a variable can be assigned to

is_valid()[source]#

Indicates whether the settings are valid

Return type:

bool

property iterations: int#

Number of iterations to apply

property low_value: float#

The low value (defined as probability) a variable can be assigned to

property max_parallel_processes: int#

The number of parallel executions of model evaluations

property reuse_calculations: bool#

Indicates whether prior model results will be reused in the sensitivity analysis.

This will speed up calculations when several analyses are performed, for which the same realizations will have to be executed, for example when calculating the sensitivity of several output parameters. But when a modification to the model is made, which is beyond the scope of the model definition, this leads to undesired results

property save_messages: bool#

Indicates whether messages generated by the reliability analysis will be saved If saved, messages will be part of the design point

property save_realizations: bool#

Indicates whether samples should be saved If saved, the samples will be part of the design point

property sensitivity_method: SensitivityMethod#

Defines the sensitivity algorithm

validate()[source]#

Prints the validity of the settings

class SensitivityValue(id, known_variables=None)[source]#

Bases: FrozenObject

Contains the result of a sensitivity analysis for a specific input variable

Several sensitivity values (one for each input variable) are listed in a sensitivity result, which contains the sensitivity results for a specific output parameter of a model.

property first_order_index: float#

The first order index of the output parameter due to variations of the input variable

property high: float#

The value the output parameter gets when the input variable is set to its high value

property low: float#

The value the output parameter gets when the input variable is set to its low value

property medium: float#

The value the output parameter gets when the input variable is set to its median value

print(decimals=4)[source]#

Prints the sensitivity value

Parameters:

decimals (int, optional) – The number of decimals to print

property total_index: float#

The total index of the output parameter due to variations of the input variable

property variable: Stochast#

The (input) stochastic variable to which these results apply