python如何做敏感度分析,使用SALib工具箱从测量数据进行Python敏感性分析

I would like to understand, how to use the SALib python toolbox to perform a Sobol sensitivity analysis (to study parameters and crossed parameters influence)

From the original example I'm supposed to proceed this way:

from SALib.sample import saltelli

from SALib.analyze import sobol

from SALib.test_functions import Ishigami

import numpy as np

problem = {

'num_vars': 3,

'names': ['x1', 'x2', 'x3'],

'bounds': [[-np.pi, np.pi]]*3

}

# Generate samples

param_values = saltelli.sample(problem, 1000)

# Run model (example)

Y = Ishigami.evaluate(param_values)

# Perform analysis

Si = sobol.analyze(problem, Y, print_to_console=True)

# Returns a dictionary with keys 'S1', 'S1_conf', 'ST', and 'ST_conf'

# (first and total-order indices with bootstrap confidence intervals

Because in my case I'm getting data from experiments, I don't have the model that is linking Xi and Yi. I just have an input matrix and an output matrix.

If we assume that my input data are generated from a Latin Hypercube (a good statistical repartition), how to use Salib to evaluate the sensitivity of my parameters? From what I see in the code:

Si = sobol.analyze(problem, Y, print_to_console=True)

We are only using input parameters boundaries and output. But with this approach how is it possible to know which parameter is evolving between two sets ?

thanks for your help!

解决方案

There is no direct way to compute the Sobol indices using SAlib based on your description of the data. SAlib computes the first- and total-order indices by generating two matrices (A and B) and then using additional values generated by cross-sampling a value from matrix B in matrix A. The diagram below shows how this is done. When the code evaluates the indices it expects the model output to be in this order. The method of computing indices this way is based on the methods published by Saltelli et al. (2010). Because this is not a Latin hypercube sampling method, the experimental data will most likely not work.

One possible method to still complete a sensitivity analysis is to use a surrogate or meta model from your experimental data. In this case you could use the experimental data to fit an approximation of your true model. This approximation can then be analyzed by SAlib or another sensitivity package. The surrogate model is typically a polynomial or based on kriging. Iooss et al (2006) describes some methods. Some software for this method includes UQlab (http://www.uqlab.com/, MATLAB-based) and BASS (https://cran.r-project.org/web/packages/BASS/index.html, R package) among others depending on the specific type of model and fitting techniques you want to use.

Another possibility is to find an estimator that is not based on the Saltelli et al (2010) method. I am not sure if such an estimator exists, but it would probably be better to post that question in the Math or Probability and Statistics Stack Exchanges.

References:

Iooss, B, F. Van Dorpe, N. Devictor. (2006). "Response surfaces and sensitivity analyses for an environmental model of dose calculations". Reliability Engineering and System Safety 91:1241-1251.

Saltelli, A., P. Annoni, I. Azzini, F. Campolongo, M. Ratto, S. Tarantola. 2010. "Variance based sensitivity analysis of model output. Design and estimator for the total sensitivity index". Computer Physics Communications 181:259-270.

你可能感兴趣的:(python如何做敏感度分析)