ShapleyX — Global Sensitivity Analysis with RS-HDMR
ShapleyX is a Python package for global sensitivity analysis using Random Sampling High-Dimensional Model Representation (RS-HDMR). It builds sparse polynomial surrogate models via Automatic Relevance Determination (ARD) regression and extracts Sobol indices, Shapley effects, and moment-free sensitivity measures — with full support for correlated inputs through Monte Carlo Shapley estimation.
Installation
pip install shapleyx
To upgrade:
pip install --upgrade shapleyx
From GitHub (development version)
pip install https://github.com/frbennett/shapleyx/archive/main.zip
Features
-
Variance-based indices:
- Sobol sensitivity indices to arbitrary order
- Shapley effects (independent inputs, via coefficient decomposition)
- Monte Carlo Shapley effects for correlated inputs (Owen & Prieur 2017)
- Owen-Shapley interaction indices
- Total sensitivity indices
-
Moment-free measures:
- PAWN (density-based)
- Delta index (moment-independent)
- H-index (distribution-based)
-
Distribution classes for correlated inputs:
GaussianCopulaUniform— uniform marginals with latent normal dependenceMultivariateNormal— jointly normal with analytical conditional samplingTruncatedMultivariateNormal— per-dimension truncation bounds with Gibbs sampling
-
Computation methods:
- Exhaustive subset enumeration (exact, for $d \le 8$)
- Random permutation method (scalable, for larger $d$)
-
Infrastructure:
- Legendre polynomial expansion on $[0,1]^d$
- Automatic Relevance Determination (ARD) with Bayesian cross-validation
- Bootstrap resampling for confidence intervals
- Progress bars (via tqdm, optional) and Numba-accelerated bootstrap (optional)
Dependencies
| Required | Optional |
|---|---|
numpy |
numba (compiled bootstrap & Legendre evals) |
scipy |
tqdm (progress bars) |
pandas |
|
matplotlib |
|
scikit-learn |
Documentation
Full documentation is available at:
Examples
Jupyter notebooks demonstrating usage:
| Notebook | Description |
|---|---|
| Ishigami Function | Basic RS-HDMR workflow with Sobol & Shapley |
| MC Shapley | Monte Carlo Shapley for correlated inputs |
| Truncated Normal | TruncatedMultivariateNormal with the Ishigami function |
| Owen Product Function | Higher-dimensional example workflow |
License
This project is licensed under the MIT License — see the LICENSE file for details.
Metadata
Release files for shapleyx 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shapleyx-0.7.0.tar.gz | 147.7 kB | With provenance | Details for shapleyx-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shapleyx-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for shapleyx-0.7.0-py3-none-any.whl |
Total release size: 300.1 kB
Release files / shapleyx-0.7.0.tar.gz
| Download URL | shapleyx-0.7.0.tar.gz |
|---|---|
| Size | 147.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95e0be88b5fe6dcdeb4cf69eef73491c5334591c19fcb148fb52d38225eeb18e
|
|
BLAKE2b-256 checksum How to use checksums |
d732cc7da91698af9e2bc96bca874b3f38735dd65d1a9d5ccbcd69470692d39b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logRelease files / shapleyx-0.7.0-py3-none-any.whl
| Download URL | shapleyx-0.7.0-py3-none-any.whl |
|---|---|
| Size | 152.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e06f3c0da34d6e5ac913fdff66cb976f556b1c0f4712929e209417ec03b5e3c
|
|
BLAKE2b-256 checksum How to use checksums |
33a2370b341e14491e1502beb7161976456b0c913ef605e663ce7557c57574c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logSecurity for shapleyx 0.7.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for shapleyx-0.7.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logA 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.