uncertain_variables
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.
- Website: https://buildchain.ilab.sztaki.hu/
- Source code: https://github.com/TRACE-Structures/uncertain_variables
- Bug reports: https://github.com/TRACE-Structures/uncertain_variables/issues
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 deviationUniformDistribution: Uniform distribution over [min, max]LogNormalDistribution: Log-normal distributionBetaDistribution: Beta distribution with shape parametersExponentialDistribution: Exponential distribution with rate parameterWignerSemicircleDistribution: Wigner semicircle distributionTranslatedDistribution: 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 distributionsHermitePolynomials: For normal distributionsJacobiPolynomials: For beta distributionsChebyshevTPolynomials: Chebyshev polynomials of the first kindChebyshevUPolynomials: Chebyshev polynomials of the second kindLaguerrePolynomials: 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
- gPCE_model: Generalized Polynomial Chaos Expansion
- digital_twinning: Digital Twinning
Support
For issues, questions, or contributions, please refer to the project repository or contact the authors.
Metadata
Release files for uncertain-variables 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uncertain_variables-1.0.2.tar.gz | 33.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uncertain_variables-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.9 kB
Release files / uncertain_variables-1.0.2.tar.gz
| Download URL | uncertain_variables-1.0.2.tar.gz |
|---|---|
| Size | 33.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
744949a7722db0b1c339c63470258a49186446314b54ee9875a0cab8569b5fb1
|
|
BLAKE2b-256 checksum How to use checksums |
97844121163aafe1de140299de235135cf79c458c14b02b88778d7c1bc584858
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency logRelease files / uncertain_variables-1.0.2-py3-none-any.whl
| Download URL | uncertain_variables-1.0.2-py3-none-any.whl |
|---|---|
| Size | 45.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68670e9ffcd62ff17543f077ce1828e1ad2ef48ef340a08a9ae8e42b17804c04
|
|
BLAKE2b-256 checksum How to use checksums |
6e607888396f777d3d296242b99730ed19a835dff8713ed1aff7d1cf8b6a90c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency log