Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Sensitivity Analysis Library (SALib)

Python implementations of commonly used sensitivity analysis methods. Useful in systems modeling to calculate the effects of model inputs or exogenous 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 or python setup.py install or conda install SALib

Build Status: Build Status Test Coverage: Coverage Status

Included methods

Contributing: see here

Quick Start

Procedural approach

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, 1024)

# 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)

It’s also possible to specify the parameter bounds in a file with 3 columns:

# name lower_bound upper_bound
P1 0.0 1.0
P2 0.0 5.0
...etc.

Then the problem dictionary above can be created from the read_param_file function:

from SALib.util import read_param_file
problem = read_param_file('/path/to/file.txt')
# ... same as above

Lots of other options are included for parameter files, as well as a command-line interface. See the advanced section in the documentation.

Method chaining approach

Chaining calls is supported from SALib v1.4

from SALib import ProblemSpec
from SALib.test_functions import Ishigami

import numpy as np


# 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 provided
sp.plot()

The above is equivalent to the procedural approach shown previously.

Also check out the examples for a full description of options for each method.

How to cite SAlib

If you would like to use our software, please cite it using the following:

Herman, J. and Usher, W. (2017) SALib: An open-source Python library for sensitivity analysis. Journal of Open Source Software, 2(9). doi:10.21105/joss.00097

paper status

If you use BibTeX, cite using the following entry:

@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}
}

Projects that use SALib

Many projects now use the Global Sensitivity Analysis features provided by SALib. Here is a selection:

Software

Blogs

Videos

If you would like to be added to this list, please submit a pull request, or create an issue.

Many thanks for using SALib.

How to contribute

See here for how to contribute to SAlib.

License

Copyright (C) 2012-2019 Jon Herman, Will Usher, and others. Versions v0.5 and later are released under the MIT license.

Metadata

Release files for SALib 1.4.4.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SALib 1.4.4.dev2
File Size Uploaded Provenance Actions
SALib-1.4.4.dev2.tar.gz 905.2 kB Without provenance Details for SALib-1.4.4.dev2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for SALib 1.4.4.dev2
File Interpreter ABI Platform Actions
SALib-1.4.4.dev2-py2.py3-none-any.whl Python 2, Python 3 none any Details for SALib-1.4.4.dev2-py2.py3-none-any.whl

Total release size: 1.7 MB

Release files / SALib-1.4.4.dev2.tar.gz

Download URL SALib-1.4.4.dev2.tar.gz
Size 905.2 kB
Tags Source
SHA-256 checksum
How to use checksums
322eca3d5ac770b8d1ebbbaa832cc8fb63abdc8fdc6a3d824c001a67184149bc
BLAKE2b-256 checksum
How to use checksums
a603b9e308c8aa9bc9a19759de439dd8a9c03b7be972e7a0be4a4ddf96c73e5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

Release files / SALib-1.4.4.dev2-py2.py3-none-any.whl

Download URL SALib-1.4.4.dev2-py2.py3-none-any.whl
Size 755.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1244766326973f951642aaffa05211832bad8e0bd85cc339beafdef0c75e7fab
BLAKE2b-256 checksum
How to use checksums
45bcf75fc0cc801400e4e55cd1856229ba9b14cc5478c67d6e80c920a6bfc0a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

Security for SALib 1.4.4.dev2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page