- Notifications
You must be signed in to change notification settings - Fork253
Sensitivity Analysis Library in Python. Contains Sobol, Morris, FAST, and other methods.
License
SALib/SALib
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Python implementations of commonly used sensitivity analysis methods.Useful in systems modeling to calculate the effects of model inputs orexogenous factors on outputs of interest.
Documentation:ReadTheDocs
Requirements:NumPy,SciPy,matplotlib,pandas,Python 3 (from SALib v1.2 onwards SALib does not officially support Python 2)
Installation:pip install SALib orpip install . orconda install SALib
- Sobol Sensitivity Analysis (Sobol 2001,Saltelli 2002,Saltelli et al. 2010)
- Method of Morris, including groups and optimal trajectories (Morris1991,Campolongo et al. 2007,Ruano et al. 2012)
- extended Fourier Amplitude Sensitivity Test (eFAST) (Cukier et al. 1973,Saltelli et al. 1999,Pujol (2006) in Iooss et al., (2021))
- Random Balance Designs - Fourier Amplitude Sensitivity Test (RBD-FAST) (Tarantola et al. 2006,Plischke 2010,Tissot et al. 2012)
- DeltaMoment-Independent Measure (Borgonovo 2007,Plischke et al. 2013)
- Derivative-based Global Sensitivity Measure (DGSM) (Sobol andKucherenko 2009)
- Fractional Factorial Sensitivity Analysis(Saltelli et al. 2008)
- High-Dimensional Model Representation (HDMR)(Rabitz et al. 1999,Li et al. 2010)
- PAWN (Pianosi and Wagener 2018,Pianosi and Wagener 2015)
- Regional Sensitivity Analysis (based onHornberger and Spear, 1981,Saltelli et al. 2008,Pianosi et al., 2016)
Contributing: seehere
fromSALib.sampleimportsaltellifromSALib.analyzeimportsobolfromSALib.test_functionsimportIshigamiimportnumpyasnpproblem= {'num_vars':3,'names': ['x1','x2','x3'],'bounds': [[-np.pi,np.pi]]*3}# Generate samplesparam_values=saltelli.sample(problem,1024)# 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)
It's also possible to specify the parameter bounds in a file with 3columns:
# name lower_bound upper_boundP1 0.0 1.0P2 0.0 5.0...etc.
Then theproblem dictionary above can be created from theread_param_file function:
fromSALib.utilimportread_param_fileproblem=read_param_file('/path/to/file.txt')# ... same as above
Lots of other options are included for parameter files, as well as acommand-line interface. See theadvancedsection in the documentation.
Chaining calls is supported from SALib v1.4
fromSALibimportProblemSpecfromSALib.test_functionsimportIshigamiimportnumpyasnp# By convention, we assign to "sp" (for "SALib Problem")sp=ProblemSpec({'names': ['x1','x2','x3'],# Name of each parameter'bounds': [[-np.pi,np.pi]]*3,# bounds of each parameter'outputs': ['Y']# name of outputs in expected order})(sp.sample_saltelli(1024,calc_second_order=True) .evaluate(Ishigami.evaluate) .analyze_sobol(print_to_console=True))print(sp)# Samples, model results and analyses can be extracted:print(sp.samples)print(sp.results)print(sp.analysis)# Basic plotting functionality is also providedsp.plot()
The above is equivalent to the procedural approach shown previously.
Also check out theFAQ andexamples for afull description of options for each method.
If you would like to use our software, please cite it using the following:
Iwanaga, T., Usher, W., & Herman, J. (2022).Toward SALib 2.0: Advancing the accessibility and interpretability of global sensitivity analyses.Socio-Environmental Systems Modelling, 4, 18155.doi:10.18174/sesmo.18155
Herman, J. and Usher, W. (2017) SALib: An open-source Python library forsensitivity analysis. Journal of Open Source Software, 2(9).doi:10.21105/joss.00097
If you use BibTeX, cite using the following entries:
@article{Iwanaga2022, title = {Toward {SALib} 2.0: {Advancing} the accessibility and interpretability of global sensitivity analyses}, volume = {4}, url = {https://sesmo.org/article/view/18155}, doi = {10.18174/sesmo.18155}, journal = {Socio-Environmental Systems Modelling}, author = {Iwanaga, Takuya and Usher, William and Herman, Jonathan}, month = may, year = {2022}, pages = {18155},}@article{Herman2017, doi = {10.21105/joss.00097}, url = {https://doi.org/10.21105/joss.00097}, year = {2017}, month = {jan}, publisher = {The Open Journal}, volume = {2}, number = {9}, author = {Jon Herman and Will Usher}, title = {{SALib}: An open-source Python library for Sensitivity Analysis}, journal = {The Journal of Open Source Software}}Many projects now use the Global Sensitivity Analysis features provided bySALib. Here is a selection:
- The City Energy Analyst
- pynoddy
- savvy
- rhodium
- pySur
- EMA workbench
- Brain/Circulation Model Developer
- DAE Tools
- agentpy
- uncertainpy
- CLIMADA
- Sensitivity Analysis in Python
- Sensitivity Analysis with SALib
- Running Sobol using SALib
- Extensions of SALib for more complex sensitivity analyses
If you would like to be added to this list, please submit a pull request,or create an issue.
Many thanks for using SALib.
Seehere for how to contribute to SALib.
Copyright (C) 2012-2019 Jon Herman, Will Usher, and others. Versions v0.5 andlater are released under theMIT license.
About
Sensitivity Analysis Library in Python. Contains Sobol, Morris, FAST, and other methods.
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
