Skip to main content

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.

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 dependence
    • MultivariateNormal — jointly normal with analytical conditional sampling
    • TruncatedMultivariateNormal — 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)

Installation

From GitHub (latest version)

pip install https://github.com/frbennett/shapleyx/archive/main.zip

To upgrade:

pip uninstall -y shapleyx
pip install https://github.com/frbennett/shapleyx/archive/main.zip

Development Installation

git clone https://github.com/frbennett/shapleyx.git
cd shapleyx
python setup.py develop

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

shapleyx-0.5.0.tar.gz (124.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shapleyx-0.5.0-py3-none-any.whl (130.4 kB view details)

Uploaded Python 3

File details

Details for the file shapleyx-0.5.0.tar.gz.

File metadata

  • Download URL: shapleyx-0.5.0.tar.gz
  • Upload date:
  • Size: 124.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shapleyx-0.5.0.tar.gz
Algorithm Hash digest
SHA256 78d27882febfdf7cf9d23e0d4ea8ca57dc9d073c20d296d22320a6f399874a5f
MD5 7d5a519976aff78801e044f63314981c
BLAKE2b-256 0918d594774f8009dafc83742514848da39f424493caae3b815eab13521b5ef2

See more details on using hashes here.

Provenance

The following attestation bundles were made for shapleyx-0.5.0.tar.gz:

Publisher: pypi-publish.yml on frbennett/shapleyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shapleyx-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: shapleyx-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 130.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shapleyx-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87811be6ef65ceea1af99995c7d7b649948b15b2e3849dce50b874f77fe25cbe
MD5 8d4f2becab63d79d1b3284e81cccd7cd
BLAKE2b-256 31b74562bd57d29c6077f4d196c00df99f67ad2342f1c59474abe2169ce931f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for shapleyx-0.5.0-py3-none-any.whl:

Publisher: pypi-publish.yml on frbennett/shapleyx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page