敏感性分析工具。包含sobol、morris和fast方法
SALib的Python项目详细描述
常用灵敏度分析方法的python实现。 在系统建模中用于计算模型输入或 利益输出的外生因素。
文档:ReadTheDocs
要求:NumPy, SciPy, matplotlib, pandas, Python3(从Salibv1.2开始,Salib不正式支持Python2)
安装:pip install SALib或python setup.py install或conda install SALib
Herman, J., Usher, W., (2017), SALib: An open-source Python library for Sensitivity Analysis, Journal of Open Source Software, 2(9), 97, doi:10.21105/joss.00097
包含的方法:
- Sobol敏感性分析(Sobol 2001, Saltelli 2002, Saltelli et al. 2010)
- morris方法,包括群和最优轨迹(Morris 1991, Campolongo et al. 2007)
- 傅里叶振幅灵敏度试验(快速) Saltelli et al. 1999)
- 随机平衡设计-傅里叶振幅灵敏度试验(RBD-FAST) Plischke 2010, Tissot et al. 2012)
- 三角洲 矩独立度量(Borgonovo 2007, Plischke et al. 2013)
- 基于导数的全局灵敏度测量(dgsm)(Sobol and Kucherenko 2009)
- 分数因子敏感性分析 (Saltelli et al. 2008)
贡献:请参见here
快速启动
fromSALib.sampleimportsaltellifromSALib.analyzeimportsobolfromSALib.test_functionsimportIshigamiimportnumpyasnpproblem={'num_vars':3,'names':['x1','x2','x3'],'bounds':[[-np.pi,np.pi]]*3}# Generate samplesparam_values=saltelli.sample(problem,1000)# Run model (example)Y=Ishigami.evaluate(param_values)# Perform analysisSi=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)
也可以用3指定文件中的参数界限 列:
# name lower_bound upper_bound P1 0.0 1.0 P2 0.0 5.0 ...etc.
然后可以从 read_param_file函数:
fromSALib.utilimportread_param_fileproblem=read_param_file('/path/to/file.txt')# ... same as above
参数文件包括许多其他选项,以及 命令行界面。请参阅advanced readme。
还可以查看 examples对于 每个方法的选项的完整描述。
许可证
版权所有(c)2012-2019 Jon Herman,Will Usher等。版本v0.5和 稍后将在MIT license下发布。