Global sensitivity analysis with RS-HDMR — Sobol, Shapley, PAWN, and more
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shapleyx-0.7.0.tar.gz.
File metadata
- Download URL: shapleyx-0.7.0.tar.gz
- Upload date:
- Size: 147.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95e0be88b5fe6dcdeb4cf69eef73491c5334591c19fcb148fb52d38225eeb18e
|
|
| MD5 |
486bb50d5bee31bf5cccb5ea6da3f4cf
|
|
| BLAKE2b-256 |
d732cc7da91698af9e2bc96bca874b3f38735dd65d1a9d5ccbcd69470692d39b
|
Provenance
The following attestation bundles were made for shapleyx-0.7.0.tar.gz:
Publisher:
pypi-publish.yml on frbennett/shapleyx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shapleyx-0.7.0.tar.gz -
Subject digest:
95e0be88b5fe6dcdeb4cf69eef73491c5334591c19fcb148fb52d38225eeb18e - Sigstore transparency entry: 1647625709
- Sigstore integration time:
-
Permalink:
frbennett/shapleyx@2ba2c027cb9526d3863a4c510faf1e235604d0aa -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/frbennett
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@2ba2c027cb9526d3863a4c510faf1e235604d0aa -
Trigger Event:
push
-
Statement type:
File details
Details for the file shapleyx-0.7.0-py3-none-any.whl.
File metadata
- Download URL: shapleyx-0.7.0-py3-none-any.whl
- Upload date:
- Size: 152.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e06f3c0da34d6e5ac913fdff66cb976f556b1c0f4712929e209417ec03b5e3c
|
|
| MD5 |
a15823eff3920634445dfc7c17c97ce8
|
|
| BLAKE2b-256 |
33a2370b341e14491e1502beb7161976456b0c913ef605e663ce7557c57574c3
|
Provenance
The following attestation bundles were made for shapleyx-0.7.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on frbennett/shapleyx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shapleyx-0.7.0-py3-none-any.whl -
Subject digest:
6e06f3c0da34d6e5ac913fdff66cb976f556b1c0f4712929e209417ec03b5e3c - Sigstore transparency entry: 1647625834
- Sigstore integration time:
-
Permalink:
frbennett/shapleyx@2ba2c027cb9526d3863a4c510faf1e235604d0aa -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/frbennett
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@2ba2c027cb9526d3863a4c510faf1e235604d0aa -
Trigger Event:
push
-
Statement type: