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.6.0.tar.gz (134.1 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.6.0-py3-none-any.whl (142.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for shapleyx-0.6.0.tar.gz
Algorithm Hash digest
SHA256 012749796532372a83c218f9984326e47a75e41c4e7bb11c908b115012d6745d
MD5 d4fb0556c043305465ee6259153fd536
BLAKE2b-256 123c5f28a1aea9a8a56318e62a97c2546fc98f2998c867dfcf84b215028b42c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for shapleyx-0.6.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.6.0-py3-none-any.whl.

File metadata

  • Download URL: shapleyx-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 142.8 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7a1602e77062db1c2870135d85d13c7787d9812b1c1ad3b74d3561423e7c74e
MD5 8a73e4843451116a05d30402ea052910
BLAKE2b-256 8c549ad346d595c922fc19d0220d101a1dc028cdb96156adbecc047973525669

See more details on using hashes here.

Provenance

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