One-Dimensional Marginal Distribution#
Module with an implementation of the Marginal class.
The Marginal class represents a one-dimensional marginal random variable
(i.e., univariate random variable).
Each random variable has a (parametric) probability distribution.
- class uqtestfuns.core.prob_input.marginal.Marginal(distribution: str, parameters: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], name: str | None = None, description: str | None = None, rng_seed: int | None = None)#
A class for one-dimensional marginal random variables.
- Parameters:
distribution (str) – The type of the probability distribution.
parameters (ArrayLike) – The parameters of the chosen probability distribution
name (str, optional) – The name of the random variable
description (str, optional) – The short text description of the random variable
rng_seed (int, optional.) – The seed used to initialize the pseudo-random number generator. If not specified, the value is taken from the system entropy.
- lower#
The lower bound of the distribution
- Type:
float
- upper#
The upper bound of the distribution
- Type:
float
- _rng#
The default pseudo-random number generator of NumPy. The generator is only created if or when needed (e.g., generating a random sample from the distribution).
- Type:
Generator
- cdf(xx: float | ndarray) ndarray[tuple[int, ...], dtype[float64]]#
Compute the CDF of the distribution on a set of values.
The function transforms the sample values in the domain of the distribution to the [0, 1] domain.
- get_sample(sample_size: int = 1) ndarray#
Get a random sample from the distribution.
- icdf(xx: float | ndarray) ndarray[tuple[int, ...], dtype[float64]]#
Compute the inverse CDF of the distribution on a set of values.
The function transforms values in the [0,1] domain to the domain of the distribution.
- pdf(xx: float | ndarray) ndarray[tuple[int, ...], dtype[float64]]#
Compute the PDF of the distribution on a set of values.
- reset_rng(rng_seed: int | None) None#
Reset the random number generator.
- Parameters:
rng_seed (int, optional.) – The seed used to initialize the pseudo-random number generator. If not specified, the value is taken from the system entropy.