SALib

SALib: An open-source Python library for Sensitivity Analysis - Published in JOSS (2017)

https://github.com/salib/salib

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
    12 of 50 committers (24.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

global-sensitivity-analysis joss morris numpy python salib sensitivity-analysis sensitivity-analysis-library sobol uncertainty uncertainty-quantification

Scientific Fields

Mathematics Computer Science - 84% confidence
Last synced: 4 months ago · JSON representation ·

Repository

Sensitivity Analysis Library in Python. Contains Sobol, Morris, FAST, and other methods.

Basic Info
Statistics
  • Stars: 943
  • Watchers: 19
  • Forks: 250
  • Open Issues: 64
  • Releases: 33
Topics
global-sensitivity-analysis joss morris numpy python salib sensitivity-analysis sensitivity-analysis-library sobol uncertainty uncertainty-quantification
Created over 12 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Authors Zenodo

README-advanced.md

SALib: Advanced options

Parameter files

In the parameter file, lines beginning with # will be treated as comments and ignored. ```

name lowerbound upperbound

P1 0.0 1.0 P2 0.0 5.0 P3 0.0 5.0 ...etc. ``` Parameter files can also be comma-delimited if your parameter names or group names contain spaces. This should be detected automatically.

Command-line interface

Generate samples (the -p flag is the parameter file) salib sample saltelli \ -n 1024 \ -p ./src/SALib/test_functions/params/Ishigami.txt \ -o model_input.txt

Run the model this will usually be a user-defined model, maybe even in another language. Just save the outputs.

Run the analysis salib analyze sobol \ -p ./src/SALib/test_functions/params/Ishigami.txt \ -Y model_output.txt \ -c 0

This will print indices and confidence intervals to the command line. You can redirect to a file using the > operator.

Parallel indices calculation (Sobol method only)

python Si = sobol.analyze(problem, Y, calc_second_order=True, conf_level=0.95, print_to_console=False, parallel=True, n_processors=4)

Other methods include Morris, FAST, Delta-MIM, and DGSM. For an explanation of all command line options for each method, see the examples here.

Groups of variables (Sobol and Morris methods only)

It is sometimes useful to perform sensitivity analysis on groups of input variables to reduce the number of model runs required, when variables belong to the same component of a model, or there is some reason to believe that they should behave similarly.

Groups can be specified in two ways for the Sobol and Morris methods. First, as a fourth column in the parameter file: ```

name lowerbound upperbound group_name

P1 0.0 1.0 Group1 P2 0.0 5.0 Group2 P3 0.0 5.0 Group_2 ...etc. ```

Or in the problem dictionary: python problem = { 'groups': ['Group_1', 'Group_2', 'Group_2'], 'names': ['x1', 'x2', 'x3'], 'num_vars': 3, 'bounds': [[-3.14, 3.14], [-3.14, 3.14], [-3.14, 3.14]] }

groups is a list of strings specifying the group name to which each variable belongs. The rest of the code stays the same:

python param_values = saltelli.sample(problem, 1024) Y = Ishigami.evaluate(param_values) Si = sobol.analyze(problem, Y, print_to_console=True)

But the output is printed by group: ``` Group S1 S1conf ST STconf Group1 0.307834 0.066424 0.559577 0.082978 Group2 0.444052 0.080255 0.667258 0.060871

Group1 Group2 S2 S2conf Group1 Group_2 0.242964 0.124229 ```

The output can then be converted to a Pandas DataFrame for further analysis.

python total_Si, first_Si, second_Si = Si.to_df()

Generating alternate distributions

In the Quick Start we generate a uniform sample of parameter space.

```python 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': [[-3.14159265359, 3.14159265359], [-3.14159265359, 3.14159265359], [-3.14159265359, 3.14159265359]] }

param_values = saltelli.sample(problem, 1024) ```

SALib is also capable of generating alternate sampling distributions by specifying a dist entry in the problem specification.

As implied in the basic example, a uniform distribution is the default.

When an entry for dist is not 'unif', the bounds entry does not indicate parameter bounds but sample-specific metadata.

bounds definitions for available distributions:

  • unif: uniform distribution e.g. :code:[-np.pi, np.pi] defines the lower and upper bounds
  • triang: triangular with lower and upper bounds, as well as location of peak The location of peak is in percentage of width e.g. :code:[1.0, 3.0, 0.5] indicates 1.0 to 3.0 with a peak at 2.0

    A soon-to-be deprecated two-value format assumes the lower bound to be 0 e.g. :code:[3, 0.5] assumes 0 to 3, with a peak at 1.5

  • norm: normal distribution with mean and standard deviation

  • lognorm: lognormal with ln-space mean and standard deviation

An example specification is shown below:

python problem = { 'names': ['x1', 'x2', 'x3'], 'num_vars': 3, 'bounds': [[-np.pi, np.pi], [1.0, 0.2], [3, 0.5]], 'groups': ['G1', 'G2', 'G1'], 'dists': ['unif', 'lognorm', 'triang'] }

Owner

  • Name: SALib
  • Login: SALib
  • Kind: organization

Sensitivity analysis library for systems modeling

JOSS Publication

SALib: An open-source Python library for Sensitivity Analysis
Published
January 10, 2017
Volume 2, Issue 9, Page 97
Authors
Jon Herman ORCID
University of California, Davis
Will Usher ORCID
University of Oxford
Editor
Kyle Niemeyer ORCID
Tags
sensitivity analysis uncertainty variance-based global sensitivity analysis fractional factorial Method of Morris

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Iwanaga"
  given-names: "Takuya"
  orcid: "0000-0001-8173-0870"
- family-names: "Usher"
  given-names: "Will"
  orcid: "0000-0001-9367-1791"
- family-names: "Herman"
  given-names: "Jon"
  orcid: "0000-0002-4081-3175"
title: "SALib: An open-source Python library for sensitivity analysis"
version: 1.4.6.1
doi: 10.21105/joss.00097
date-released: 2022-05-01
url: "https://github.com/SALib/SALib"
preferred-citation:
  type: article
  authors:
  - family-names: "Iwanaga"
    given-names: "Takuya"
    orcid: "0000-0001-8173-0870"
  - family-names: "Usher"
    given-names: "Will"
    orcid: "0000-0001-9367-1791"
  - family-names: "Herman"
    given-names: "Jon"
    orcid: "0000-0002-4081-3175"
  doi: "10.18174/sesmo.18155"
  journal: "Socio-Environmental Systems Modelling"
  month: 5
  start: 1 # First page number
  end: 15 # Last page number
  title: "Toward SALib 2.0: Advancing the accessibility and interpretability of global sensitivity analyses"
  issue: 1
  volume: 4
  year: 2022

GitHub Events

Total
  • Issues event: 12
  • Watch event: 63
  • Issue comment event: 45
  • Push event: 8
  • Pull request event: 9
  • Pull request review event: 3
  • Fork event: 16
  • Create event: 2
Last Year
  • Issues event: 12
  • Watch event: 63
  • Issue comment event: 45
  • Push event: 8
  • Pull request event: 9
  • Pull request review event: 3
  • Fork event: 16
  • Create event: 2

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 1,539
  • Total Committers: 50
  • Avg Commits per committer: 30.78
  • Development Distribution Score (DDS): 0.561
Past Year
  • Commits: 11
  • Committers: 8
  • Avg Commits per committer: 1.375
  • Development Distribution Score (DDS): 0.727
Top Committers
Name Email Commits
ConnectedSystems t****i@g****m 676
Will Usher w****r@u****k 382
jdherman j****8@g****m 173
Pamphile Roy r****e@g****m 68
Lucas Teixeira l****g@g****m 65
Abdullah Sahin s****i@g****m 36
Nandi Moksnes n****s@g****m 13
Nicolas Cellier c****t@n****t 12
Calvin Whealton c****4@c****u 10
Sebastian Schmitt s****t@k****e 10
jdherman j****3@p****u 7
Martin m****d@g****m 7
Qian Wang q****n@h****n 5
simonmarwitz s****z@u****e 5
xantares x****9@h****m 5
Benjamin A. Beasley c****e@m****t 5
Joeri van Engelen j****n@d****l 5
David Hadka d****9@a****u 4
bernardoct b****2@c****u 4
zoidy z****y 4
Efe Yarbasi e****i@g****m 3
TobiasKAndersen t****n@g****m 3
Jörg Buchwald j****d@u****e 3
Chris Mutel c****l@g****m 3
Ankur Sinha (Ankur Sinha Gmail) s****r@g****m 2
Erik Cederstrand e****k@c****k 2
zzj 2****h 2
Marin Visscher m****r@c****l 2
daniel.hyams d****s@p****m 2
Joël Foramitti 5****i 1
and 20 more...

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 113
  • Total pull requests: 90
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 76
  • Total pull request authors: 26
  • Average comments per issue: 4.52
  • Average comments per pull request: 2.26
  • Merged pull requests: 71
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 17
  • Pull requests: 15
  • Average time to close issues: about 13 hours
  • Average time to close pull requests: about 17 hours
  • Issue authors: 15
  • Pull request authors: 6
  • Average comments per issue: 2.53
  • Average comments per pull request: 0.27
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ConnectedSystems (17)
  • willu47 (8)
  • tupui (6)
  • Rishitha-28 (3)
  • TobiasKAndersen (2)
  • WangYuNeng (2)
  • arkanoid87 (2)
  • morrowcj (2)
  • chahank (2)
  • jennywang123 (2)
  • JoCook1997 (2)
  • mschrader15 (1)
  • AtishnalChand (1)
  • 21574081 (1)
  • MarAlder (1)
Pull Request Authors
  • ConnectedSystems (39)
  • tupui (19)
  • eyyarbasi (7)
  • willu47 (4)
  • musicinmybrain (4)
  • sahin-abdullah (3)
  • Zapiano (2)
  • jornbr (2)
  • singhravi1 (2)
  • leonardoobaptistaa (2)
  • AnbazhaganS (2)
  • joaoantoniocardoso (2)
  • jyangfsu (1)
  • j-chacon (1)
  • joergbuchwald (1)
Top Labels
Issue Labels
enhancement (10) question (9) bug (7) documentation (7) question_interpretation (4) clean up/maintenance (2) need_help (1) in progress (1) good_for_first_issue (1)
Pull Request Labels
documentation (15) clean up/maintenance (14) enhancement (13) bug (9) add_method (2) in progress (2)

Packages

  • Total packages: 5
  • Total downloads:
    • pypi 157,596 last-month
  • Total docker downloads: 2,610
  • Total dependent packages: 21
    (may contain duplicates)
  • Total dependent repositories: 84
    (may contain duplicates)
  • Total versions: 157
  • Total maintainers: 3
pypi.org: salib

Tools for global sensitivity analysis. Contains Sobol', Morris, FAST, DGSM, PAWN, HDMR, Moment Independent and fractional factorial methods

  • Versions: 49
  • Dependent Packages: 19
  • Dependent Repositories: 64
  • Downloads: 157,596 Last month
  • Docker Downloads: 2,610
Rankings
Dependent packages count: 0.4%
Downloads: 1.0%
Average: 1.1%
Dependent repos count: 1.8%
Last synced: 12 months ago
proxy.golang.org: github.com/salib/salib
  • Versions: 48
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 4 months ago
proxy.golang.org: github.com/SALib/SALib
  • Versions: 48
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 4 months ago
conda-forge.org: 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.

  • Versions: 11
  • Dependent Packages: 2
  • Dependent Repositories: 10
Rankings
Dependent repos count: 11.1%
Forks count: 12.4%
Average: 14.6%
Stargazers count: 15.1%
Dependent packages count: 19.6%
Last synced: 4 months ago
anaconda.org: 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.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 10
Rankings
Forks count: 22.3%
Stargazers count: 26.6%
Average: 34.6%
Dependent repos count: 38.4%
Dependent packages count: 51.2%
Last synced: 4 months ago

Dependencies

.github/workflows/lint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/release.yaml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/test.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • conda-incubator/setup-miniconda v2 composite
pyproject.toml pypi
  • matplotlib >=3.2.2
  • multiprocess *
  • numpy >=1.20.3
  • pandas >=1.2
  • scipy >=1.7.3
environment.yml pypi
  • myst_parser *