Skip to main content

Global sensitivity analysis with RS-HDMR — Sobol, Shapley, PAWN, and more

Project description

ShapleyX — Global Sensitivity Analysis with RS-HDMR

PyPI Python License

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 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)

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.7.0.tar.gz (147.7 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.7.0-py3-none-any.whl (152.4 kB view details)

Uploaded Python 3

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

Hashes for shapleyx-0.7.0.tar.gz
Algorithm Hash digest
SHA256 95e0be88b5fe6dcdeb4cf69eef73491c5334591c19fcb148fb52d38225eeb18e
MD5 486bb50d5bee31bf5cccb5ea6da3f4cf
BLAKE2b-256 d732cc7da91698af9e2bc96bca874b3f38735dd65d1a9d5ccbcd69470692d39b

See more details on using hashes here.

Provenance

The following attestation bundles were made for shapleyx-0.7.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.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

Hashes for shapleyx-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e06f3c0da34d6e5ac913fdff66cb976f556b1c0f4712929e209417ec03b5e3c
MD5 a15823eff3920634445dfc7c17c97ce8
BLAKE2b-256 33a2370b341e14491e1502beb7161976456b0c913ef605e663ce7557c57574c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for shapleyx-0.7.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