gemseo / algos

parameter_space module

Parameter space including both deterministic and uncertain parameters

Overview

The ParameterSpace class describes a set of parameters of interest which can be either deterministic or uncertain. This class inherits from DesignSpace.

Capabilities

The DesignSpace.add_variable() aims to add deterministic variables from:

  • a variable name,

  • a variable size (default: 1),

  • a variable type (default: float),

  • a lower bound (default: - infinity),

  • an upper bound (default: + infinity),

  • a current value (default: None).

The add_random_variable() aims to add uncertain variables (a.k.a. random variables) from:

The ParameterSpace also provides the following methods:

class gemseo.algos.parameter_space.ParameterSpace(print_decimals=2, shorten=True, copula='independent_copula')[source]

Bases: gemseo.algos.design_space.DesignSpace

Parameter space.

Constructor

Parameters
  • print_decimals (int) – number of decimals to print. Default: 2.

  • shorten (bool) – if True, simplify the expressions of variable transformations. Default: True.

  • copula (str) – copula name. Default: ComposedDistribution.INDEPENDENT_COPULA.

BLANK = ''
INITIAL_DISTRIBUTION = 'Initial distribution'
MEAN = 'Mean'
PARAMETER_SPACE = 'Parameter space'
RANGE = 'Range'
STANDARD_DEVIATION = 'Standard deviation'
SUPPORT = 'Support'
TRANSFORMATION = 'Transformation'
add_random_variable(name, distribution, size=1, **parameters)[source]

Add a random variable from a distribution

Parameters
  • name (str) – name of the random variable.

  • distribution (str) – distribution name.

  • size (int) – variable size.

  • parameters – parameters of the distribution.

get_cdf(value, inverse=False)[source]
Get the inverse Cumulative Density Function

values of the different marginals.

Parameters

value (dict(array)) – values

Returns

(inverse) CDF values

Return type

dict(array)

get_composed_distribution(variable)[source]

Get the composed distribution of a random variable.

Parameters

variable (str) – variable name.

get_marginal_distributions(variable)[source]

Get the marginal distributions of a random variable.

Parameters

variable (str) – variable name.

get_range(variable)[source]

Get the numerical range of a random variable.

Parameters

variable (str) – variable name.

get_sample(n_samples=1, as_dict=False)[source]

Get sample.

Parameters
  • n_samples (int) – number of samples.

  • as_dict (bool) – return a dictionary.

Returns

samples

Return type

list(array) or list(dict)

get_support(variable)[source]

Get the mathematical support of a random variable.

Parameters

variable (str) – variable name.

is_deterministic(variable)[source]

Check if a variable is deterministic.

Parameters

variable (str) – variable name.

is_uncertain(variable)[source]

Check if a variable is uncertain.

Parameters

variable (str) – variable name.

normalize_vect(x_vect, minus_lb=True, use_dist=False)[source]

Normalizes a vector of the design space. Unbounded variables are not normalized.

Parameters
  • x_vect (array) – design variables.

  • minus_lb (bool) – if True, remove lower bounds at normalization.

  • no_check (bool) – if True, don’t check that values are in [0,1].

  • use_dist (bool) – if True, rescale wrt the stats law.

Returns

normalized vector

Return type

array

remove_variable(name)[source]

Remove a variable from the probability space.

Parameters

name (str) – variable name.

set_dependence(variables, copula, **options)[source]

Set dependence relation between random variables.

Parameters
  • variables (list(str)) – list of variables names.

  • copula (str) – copula name.

  • options – copula options.

unnormalize_vect(x_vect, minus_lb=True, no_check=False, use_dist=True)[source]

Inverse transformation from a unit design vector. Unnormalizes a normalized vector of the design space.

Parameters
  • x_vect (array) – design variables.

  • minus_lb (bool) – if True, remove lower bounds at normalization.

  • no_check (bool) – if True, don’t check that values are in [0,1].

  • use_dist (bool) – if True, rescale wrt the stats law.

Returns

normalized vector

Return type

array