From c0c08f35e1eab7c1772c0da784edc7f7778936ab Mon Sep 17 00:00:00 2001 From: kohlhaasrebecca <rebecca.kohlhaas@outlook.com> Date: Wed, 13 Nov 2024 16:42:16 +0100 Subject: [PATCH] Update sobol docstrings --- .../post_processing/post_processing.py | 22 ++----------------- .../surrogate_models/polynomial_chaos.py | 21 ++++++++++++++---- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/bayesvalidrox/post_processing/post_processing.py b/src/bayesvalidrox/post_processing/post_processing.py index abafb123d..e61de97c7 100644 --- a/src/bayesvalidrox/post_processing/post_processing.py +++ b/src/bayesvalidrox/post_processing/post_processing.py @@ -524,19 +524,8 @@ class PostProcessing: # ------------------------------------------------------------------------- def sobol_indices(self, xlabel: str = 'Time [s]', plot_type: str = None, save:bool=True): """ - Provides Sobol indices as a sensitivity measure to infer the importance - of the input parameters. See Eq. 27 in [1] for more details. For the - case with Principal component analysis refer to [2]. - - [1] Global sensitivity analysis: A flexible and efficient framework - with an example from stochastic hydrogeology S. Oladyshkin, F.P. - de Barros, W. Nowak https://doi.org/10.1016/j.advwatres.2011.11.001 - - [2] Nagel, J.B., Rieckermann, J. and Sudret, B., 2020. Principal - component analysis and sparse polynomial chaos expansions for global - sensitivity analysis and model calibration: Application to urban - drainage simulation. Reliability Engineering & System Safety, 195, - p.106737. + Visualizes and writes out Sobol' and Total Sobol' indices of the trained metamodel. + One file is created for each index and output key. Parameters ---------- @@ -554,13 +543,6 @@ class PostProcessing: AttributeError MetaModel in given Engine needs to be of type 'pce' or 'apce'. - Returns - ------- - sobol_cell: dict - Sobol indices. - total_sobol: dict - Total Sobol indices. - """ # This function currently only supports PCE/aPCE metamod = self.engine.MetaModel diff --git a/src/bayesvalidrox/surrogate_models/polynomial_chaos.py b/src/bayesvalidrox/surrogate_models/polynomial_chaos.py index 498cb76e6..a9f72c2ea 100644 --- a/src/bayesvalidrox/surrogate_models/polynomial_chaos.py +++ b/src/bayesvalidrox/surrogate_models/polynomial_chaos.py @@ -935,8 +935,19 @@ class PCE(MetaModel): def calculate_sobol(self, save = True): """ - Calculates Sobol' indices of all possible orders and the Total Sobol' indices - based on the coefficients in the PCE. + Provides Sobol' indices as a sensitivity measure to infer the importance + of the input parameters. See Eq. 27 in [1] for more details. For the + case with Principal component analysis refer to [2]. + + [1] Global sensitivity analysis: A flexible and efficient framework + with an example from stochastic hydrogeology S. Oladyshkin, F.P. + de Barros, W. Nowak https://doi.org/10.1016/j.advwatres.2011.11.001 + + [2] Nagel, J.B., Rieckermann, J. and Sudret, B., 2020. Principal + component analysis and sparse polynomial chaos expansions for global + sensitivity analysis and model calibration: Application to urban + drainage simulation. Reliability Engineering & System Safety, 195, + p.106737. Parameters ---------- @@ -944,8 +955,10 @@ class PCE(MetaModel): Returns ------- - sobol - totalsobol + sobol : dict + Sobol' indices of all available orders. + totalsobol : dict + Total Sobol' indices """ # Extract the necessary variables -- GitLab