使用SALib工具箱从测量数据进行Python敏感性分析 [英] Python sensitivity analysis from measured data with SALib toolbox

查看:1566
本文介绍了使用SALib工具箱从测量数据进行Python敏感性分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解如何使用SALib python工具箱进行Sobol敏感性分析(以研究参数和交叉参数的影响)

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

因为在我的情况下,我从实验中获取数据,所以我没有链接Xi和Yi的模型.我只有一个输入矩阵和一个输出矩阵.

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.

如果我们假设我的输入数据是从拉丁文Hypercube(良好的统计分区)生成的,那么如何使用Salib评估我的参数的敏感性?从我在代码中看到的:

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 ?

感谢您的帮助!

推荐答案

没有直接方法根据您对数据的描述使用SAlib计算Sobol指数. SAlib通过生成两个矩阵(A和B),然后使用通过对矩阵A中的矩阵B中的值进行交叉采样而生成的附加值,来计算一阶和总索引.下图显示了如何完成此操作.当代码评估索引时,它期望模型输出按此顺序排列.这种计算索引的方法是基于Saltelli等人发表的方法. (2010).由于这不是拉丁文超立方体采样方法,因此实验数据极有可能行不通.

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.

仍然可以完成灵敏度分析的一种可能方法是使用实​​验数据中的替代模型或元模型.在这种情况下,您可以使用实验数据来拟合真实模型的近似值.然后可以通过SAlib或其他灵敏度软件包分析该近似值.代理模型通常是多项式或基于克里金法. Iooss等人(2006年)描述了一些方法.用于此方法的某些软件包括UQlab( http://www.uqlab.com/,MATLAB-基于)和BASS( https://cran.r-project .org/web/packages/BASS/index.html ,R包),具体取决于您要使用的模型的特定类型和拟合技术.

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.

另一种可能性是找到不基于Saltelli等人(2010)方法的估计量.我不确定是否存在这样的估计量,但最好在数学或概率与统计堆栈交换中发布该问题.

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.

参考文献:

Iooss,B.F. Van Dorpe,N.Devictor. (2006). 用于剂量计算环境模型的响应面和灵敏度分析".可靠性工程与系统安全91:1241-1251.

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.基于方差的模型输出灵敏度分析.总灵敏度指标的设计和估计器".计算机物理通讯181:259-270.

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.

这篇关于使用SALib工具箱从测量数据进行Python敏感性分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆