Probabilistic Input#
Module with an implementation of ProbInput class.
The ProbInput class represents a probabilistic input model.
Each probabilistic input has a set of one-dimensional marginals each of which
is defined by an instance of the Marginal class.
- class uqtestfuns.core.prob_input.probabilistic_input.ProbInput(marginals: Sequence[Marginal], copulas: Any = None, input_id: str | None = None, function_id: str | None = None, description: str | None = None, rng_seed: int | None = None)#
A class for multivariate input variables.
- Parameters:
marginals (Union[List[Marginal], Tuple[Marginal, ...]]) – A list of one-dimensional marginals (univariate random variables).
copulas (Any) – Copulas between univariate inputs that define dependence structure (currently not used).
input_id (str, optional) – The ID of the probabilistic input. If not specified, the value is None.
function_id (str, optional) – The ID of the function associated with the input. If not specified, the value is None.
description (str, optional) – The short description regarding the input model.
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.
- property copulas: Any#
Return the underlying Copulas of the probabilistic input.
- get_sample(sample_size: int = 1) ndarray#
Get a random sample from the distribution.
- Parameters:
sample_size (int) – The number of sample points in the generated sample.
- Returns:
The generated sample in an \(N\)-by-\(M\) array where \(N\) and \(M\) are the sample size and the number of input dimensions, respectively.
- Return type:
np.ndarray
- property input_dimension: int#
Return the number of constituents (random) input variables.
- property marginals: Sequence[Marginal]#
Return the sequence of Marginals that define the input variables.
- pdf(xx: ndarray) ndarray#
Get the PDF value of the distribution on a set of values.
- Parameters:
xx (np.ndarray) – Sample values (realizations) from a distribution.
- Returns:
PDF values of the distribution on the sample values.
- Return type:
np.ndarray
- 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.
- property rng_seed: int | None#
Return the seed for RNG.