Skip to main content

Implementing generalized Polynomial Chaos Expansion (gPCE) for uncertainty quantification and surrogate modeling

Project description

gPCE_model

DOI

A Python package implementing generalized Polynomial Chaos Expansion (gPCE) for uncertainty quantification and surrogate modeling. The software is built on Elmar Zander's sglib approach.

Overview

The gPCE_model package provides a complete framework for building and using generalized Polynomial Chaos Expansion (gPCE) surrogate models. These models efficiently approximate computational expensive simulations while quantifying uncertainty in the outputs. The implementation supports various polynomial systems, multi-index generation, and comprehensive uncertainty analysis including Sobol sensitivity indices.

Installation

pip install gPCE-model

Features

  • Generalized Polynomial Chaos Expansion: Build surrogate models using orthogonal polynomial bases
  • Multiple Training Methods:
    • Regression-based coefficient computation
    • Projection-based coefficient computation
  • Multi-index Management: Flexible basis construction with total degree or full tensor product
  • Uncertainty Quantification:
    • Mean and variance computation
    • Sobol sensitivity indices (partial variances)
    • SHAP value integration for interpretability
  • Orthogonal Polynomial Support: Works with various polynomial systems (Hermite, Legendre, Jacobi, etc.)
  • Model Export: JSON-LD metadata export for interoperability

Core Components

GpcModel Class

The main class for generalized polynomial chaos expansion models.

Key Attributes:

  • basis: GpcBasis object containing basis functions
  • Q: VariableSet defining probabilistic input variables
  • u_alpha_i: Coefficients of the gPCE expansion
  • p: Maximum polynomial degree

Key Methods:

  • compute_coeffs_by_regression(q_k_j, u_k_i): Train using least squares regression
  • compute_coeffs_by_projection(q_k_j, u_k_i, w_k): Train using quadrature projection
  • predict(q_k_j): Predict output at new input points
  • mean(): Compute mean of the gPCE model
  • variance(): Compute variance of the gPCE model
  • compute_partial_vars(model_obj, max_index=1): Compute Sobol sensitivity indices

GpcBasis Class

Manages the polynomial basis functions for gPCE.

Key Attributes:

  • m: Number of random variables
  • syschars: System characters defining polynomial types
  • p: Maximum polynomial degree
  • I: Multi-index set defining basis functions

Key Methods:

  • evaluate(xi, dual=False): Evaluate basis functions at given points
  • norm(do_sqrt=True): Compute norm of basis functions
  • size(): Get size of the multi-index set

Multi-index Functions

Functions for generating and managing multi-index sets.

  • multiindex(m, p, full_tensor=False): Generate multi-index set for m variables and degree p
  • np_sortrows(M, columns=None): Sort rows of 2D array by specified columns

Authors and acknowledgment

The code is developed by András Urbanics, Bence Popovics, Emese Vastag, Elmar Zander and Noémi Friedman in the TRACE-Structures group.

This work has been funded by the European Commission Horizon Europe Innovation Action project 101092052 BUILDCHAIN

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0-only). See the LICENSE file for details.

Related Projects

Support

For questions or issues, please refer to the project repository or contact the development team.

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

gpce_model-0.1.8.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

gpce_model-0.1.8-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file gpce_model-0.1.8.tar.gz.

File metadata

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

File hashes

Hashes for gpce_model-0.1.8.tar.gz
Algorithm Hash digest
SHA256 d7cf8112c2becbe76663895747e1f8efa9b4ee71bbee6f9df2f63a4e4321ac09
MD5 ff79e4755e2c8204ed4a9387c0cbdb4d
BLAKE2b-256 348688283ed46fa6bfb5fa07ff78a3b975715ac398560470c4cbd0b5f9effb5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpce_model-0.1.8.tar.gz:

Publisher: python-publish.yml on TRACE-Structures/gPCE_model

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

File details

Details for the file gpce_model-0.1.8-py3-none-any.whl.

File metadata

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

File hashes

Hashes for gpce_model-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5124d368c74071c8e032fb9f9673ca2fcf1ce7a1e7a50414cf4700a00f19b5
MD5 e4c2bdcf69275b88e5a0c939d0363ef7
BLAKE2b-256 72f9ea742796cac3cf2fb930713b96dd83649ee0441d5cb49b497f9559a0fb61

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpce_model-0.1.8-py3-none-any.whl:

Publisher: python-publish.yml on TRACE-Structures/gPCE_model

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