Skip to main content

Defining and handling variable sets with probability distributions for surrogate modelling and uncertainty quantification applications

Project description

uncertain_variables

DOI

A Python package for defining and handling variable sets with probability distributions for surrogate modelling and uncertainty quantification applications. The software is built on Elmar Zander's sglib approach.

Overview

The uncertain_variables package provides a comprehensive framework for working with random variables and their probability distributions in the context of uncertainty quantification (UQ) and surrogate modelling. It supports various sampling methods, polynomial chaos expansion (PCE) integration, and distribution transformations.

Installation

pip install uncertain-variables

Features

  • Multiple Distribution Types: Normal, Uniform, Log-Normal, Beta, Exponential, and Wigner Semicircle distributions
  • Variable Management: Create and manage sets of variables with associated probability distributions
  • Advanced Sampling Methods:
    • Monte Carlo (MC)
    • Quasi-Monte Carlo: Halton, Latin Hypercube (LHS), Sobol sequences
    • Saltelli sampling for sensitivity analysis
  • Polynomial Systems: Support for orthogonal polynomial systems (Legendre, Hermite, Jacobi, Chebyshev, Laguerre)
  • Space Transformations: Convert between parameter space, germ space, and standard normal space
  • Unit Conversion: Built-in support for physical unit conversions using pint
  • GPC Integration: Seamless integration with generalized Polynomial Chaos Expansion methods

Core Components

Distribution Classes

The package includes several distribution types in distributions.py:

  • NormalDistribution: Gaussian distribution with mean and standard deviation
  • UniformDistribution: Uniform distribution over [min, max]
  • LogNormalDistribution: Log-normal distribution
  • BetaDistribution: Beta distribution with shape parameters
  • ExponentialDistribution: Exponential distribution with rate parameter
  • WignerSemicircleDistribution: Wigner semicircle distribution
  • TranslatedDistribution: Shifted and scaled version of any base distribution

Each distribution supports:

  • Probability density function (pdf)
  • Cumulative distribution function (cdf)
  • Inverse CDF / Percent point function (ppf)
  • Moment calculation (mean, var, moments)
  • Sampling (sample)
  • Space transformations (dist2base, base2dist)

Variable Class

The Variable class represents a single random or deterministic variable:

  • Associates a name with a distribution or fixed value
  • Supports physical units with automatic conversion
  • Provides access to distribution properties (mean, variance, pdf, cdf)
  • Enables germ space transformations for polynomial chaos expansions

VariableSet Class

The VariableSet class manages collections of variables:

  • Add multiple variables with unique names
  • Compute joint statistics (mean vector, variance vector, joint PDF)
  • Generate samples using various methods
  • Filter and create subsets of variables
  • Support polynomial chaos expansion workflows

Polynomial Systems

The polysys.py module implements orthogonal polynomial systems:

  • LegendrePolynomials: For uniform distributions
  • HermitePolynomials: For normal distributions
  • JacobiPolynomials: For beta distributions
  • ChebyshevTPolynomials: Chebyshev polynomials of the first kind
  • ChebyshevUPolynomials: Chebyshev polynomials of the second kind
  • LaguerrePolynomials: For exponential distributions

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 issues, questions, or contributions, please refer to the project repository or contact the authors.

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

uncertain_variables-0.1.8.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

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

uncertain_variables-0.1.8-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for uncertain_variables-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f54a84f8a4d79441bf7404ad9fa79889a79de71b0e441e175a65cba96b3a403c
MD5 5c9b349fd2e37d9af25959fd8a7d6650
BLAKE2b-256 78ed1edb536078d3cd5b0963f673d2c610ced9e4edd1635fe416c17a4a0d3dc1

See more details on using hashes here.

Provenance

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

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

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

File details

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

File metadata

File hashes

Hashes for uncertain_variables-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 04c54edafbb67eb206f6149eac5d5198cb997482045332facf190fc56b88f1dc
MD5 2ede9a1d7bd1f37cc368bc3d69f9eae8
BLAKE2b-256 52a8eb3b9b6adca272ba41caaaaffd612e7cc1a2f4631b71dd21cd4c15776850

See more details on using hashes here.

Provenance

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

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

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