SALib is an open-source Python library providing implementations of various global sensitivity analysis methods, including Sobol', Morris, FAST, DGSM, PAWN, HDMR, Moment Independent, and fractional factorial. It is currently at version 1.5.2 and maintains an active development status with somewhat regular releases.
pip install SALibVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a Sobol' sensitivity analysis using the Ishigami test function. It covers defining problem parameters, generating samples using the Saltelli sampler, evaluating a model, and analyzing the results to compute sensitivity indices.
Ensure your Python environment is running Python 3.x (>=3.9 recommended for 1.5.2).
Update your code to pass NumPy arrays (e.g., `param_values`, `Y`) directly to sampling and analysis functions like `saltelli.sample()` and `sobol.analyze()`.
Upgrade NumPy in your environment to version 2.0 or newer using `pip install --upgrade numpy`.
Always use the appropriate sampling method for the chosen analysis method, as specified in the SALib documentation. E.g., `SALib.sample.saltelli` for `SALib.analyze.sobol`.
Be aware of the output normalization behavior if comparing results with other tools, and consider increasing sample size for non-centered outputs if normalization is bypassed or if convergence issues are observed.
Ensure len(Y) == X.shape[0] where X is the sample matrix from saltelli.sample()
pip install --upgrade salib # saltelli is in SALib.sample since 1.4
pip install salib
problem = {'num_vars': 3, 'names': ['x1','x2','x3'], 'bounds': [[0,1],[0,1],[0,1]]}Always include 'num_vars' in the problem dict