composed module¶
The SciPy-based joint probability distribution.
SPComposedDistribution
is a ComposedDistribution
based on the SciPy library.
Warning
For the moment,
there is no copula that can be used with SPComposedDistribution
;
if you want to introduce dependency between random variables,
please consider OTComposedDistribution
.
- class gemseo.uncertainty.distributions.scipy.composed.SPComposedDistribution(distributions, copula=None, variable='')[source]¶
Bases:
ComposedDistribution
The SciPy-based joint probability distribution.
- Parameters:
distributions (Sequence[SPDistribution]) – The marginal distributions.
copula (None) – A copula distribution defining the dependency structure between random variables; if
None
, consider an independent copula.variable (str) –
The name of the variable, if any; otherwise, concatenate the names of the random variables defined by
distributions
.By default it is set to “”.
- Raises:
NotImplementedError – When the copula is not
None
.
- compute_cdf(vector)[source]¶
Evaluate the cumulative density function (CDF).
Evaluate the CDF of the components of the random variable for a given realization of this random variable.
- compute_inverse_cdf(vector)[source]¶
Evaluate the inverse of the cumulative density function (ICDF).
- compute_samples(n_samples=1)¶
Sample the random variable.
- plot(index=0, show=True, save=False, file_path='', directory_path='', file_name='', file_extension='')¶
Plot both probability and cumulative density functions for a given component.
- Parameters:
index (int) –
The index of a component of the random variable.
By default it is set to 0.
save (bool) –
If
True
, save the figure.By default it is set to False.
show (bool) –
If
True
, display the figure.By default it is set to True.
file_path (str | Path) –
The path of the file to save the figures. If the extension is missing, use
file_extension
. If empty, create a file path fromdirectory_path
,file_name
andfile_extension
.By default it is set to “”.
directory_path (str | Path) –
The path of the directory to save the figures. If empty, use the current working directory.
By default it is set to “”.
file_name (str) –
The name of the file to save the figures. If empty, use a default one generated by the post-processing.
By default it is set to “”.
file_extension (str) –
A file extension, e.g.
'png'
,'pdf'
,'svg'
, … If empty, use a default file extension.By default it is set to “”.
- Returns:
The figure.
- Return type:
Figure
- plot_all(show=True, save=False, file_path='', directory_path='', file_name='', file_extension='')¶
Plot both probability and cumulative density functions for all components.
- Parameters:
save (bool) –
If
True
, save the figure.By default it is set to False.
show (bool) –
If
True
, display the figure.By default it is set to True.
file_path (str | Path) –
The path of the file to save the figures. If the extension is missing, use
file_extension
. If empty, create a file path fromdirectory_path
,file_name
andfile_extension
.By default it is set to “”.
directory_path (str | Path) –
The path of the directory to save the figures. If empty, use the current working directory.
By default it is set to “”.
file_name (str) –
The name of the file to save the figures. If empty, use a default one generated by the post-processing.
By default it is set to “”.
file_extension (str) –
A file extension, e.g.
'png'
,'pdf'
,'svg'
, … If empty, use a default file extension.By default it is set to “”.
- Returns:
The figures.
- Return type:
list[Figure]
- COMPOSED_DISTRIBUTION_CLASS: ClassVar[type[ComposedDistribution] | None] = None¶
The class of the joint distribution associated with this distribution, if any.
- math_lower_bound: ndarray¶
The mathematical lower bound of the random variable.
- math_upper_bound: ndarray¶
The mathematical upper bound of the random variable.
- num_lower_bound: ndarray¶
The numerical lower bound of the random variable.
- num_upper_bound: ndarray¶
The numerical upper bound of the random variable.
- property range: list[numpy.ndarray]¶
The numerical range.
The numerical range is the interval defined by the lower and upper bounds numerically reachable by the random variable.
Here, the numerical range of the random variable is defined by one array for each component of the random variable, whose first element is the lower bound of this component while the second one is its upper bound.
- standard_parameters: dict[str, str] | None¶
The standard representation of the parameters of the distribution, used for its string representation.
- property support: list[numpy.ndarray]¶
The mathematical support.
The mathematical support is the interval defined by the theoretical lower and upper bounds of the random variable.
Here, the mathematical range of the random variable is defined by one array for each component of the random variable, whose first element is the lower bound of this component while the second one is its upper bound.