gemseo / uncertainty / sensitivity / hsic

Show inherited members

analysis module

Sensitivity analysis based on the Hilbert-Schmidt independence criterion (HSIC).

class gemseo.uncertainty.sensitivity.hsic.analysis.HSICAnalysis(disciplines, parameter_space, n_samples, output_names=(), algo='', algo_options=mappingproxy({}), formulation='MDF', **formulation_options)[source]

Bases: SensitivityAnalysis

Sensitivity analysis based on the Hilbert-Schmidt independence criterion (HSIC).

Examples

>>> from numpy import pi
>>> from gemseo import create_discipline, create_parameter_space
>>> from gemseo.uncertainty.sensitivity.hsic.analysis import HSICAnalysis
>>> from gemseo.uncertainty.use_cases.ishigami.ishigami_discipline import (
...     IshigamiDiscipline,
... )
>>> from gemseo.uncertainty.use_cases.ishigami.ishigami_space import (
...     IshigamiSpace,
... )
>>>
>>> discipline = IshigamiDiscipline()
>>> uncertain_space = IshigamiSpace()
>>>
>>> analysis = HSICAnalysis([discipline], uncertain_space, n_samples=1000)
>>> indices = analysis.compute_indices()
Parameters:
  • disciplines (Collection[MDODiscipline]) – The discipline or disciplines to use for the analysis.

  • parameter_space (ParameterSpace) – A parameter space.

  • n_samples (int) – A number of samples. If None, the number of samples is computed by the algorithm.

  • output_names (Iterable[str]) –

    The disciplines’ outputs to be considered for the analysis. If empty, use all the outputs.

    By default it is set to ().

  • algo (str) –

    The name of the DOE algorithm. If empty, use the SensitivityAnalysis.DEFAULT_DRIVER.

    By default it is set to “”.

  • algo_options (Mapping[str, DOELibraryOptionType]) –

    The options of the DOE algorithm.

    By default it is set to {}.

  • formulation (str) –

    The name of the MDOFormulation to sample the disciplines.

    By default it is set to “MDF”.

  • **formulation_options (Any) – The options of the MDOFormulation.

class AnalysisType(value)[source]

Bases: StrEnum

The sensitivity analysis type.

GLOBAL = 'global'

Global analysis.

class CovarianceModel(value)[source]

Bases: StrEnum

The covariance model type.

GAUSSIAN = 'Gaussian'

Squared exponential covariance model.

class Method(value)[source]

Bases: StrEnum

The name of the sensitivity method.

HSIC = 'HSIC'

The HSIC indices.

R2_HSIC = 'R2-HSIC'

The normalized HSIC (R2-HSIC) indices.

class StatisticEstimator(value)[source]

Bases: StrEnum

The statistic estimator type.

USTAT = 'U-statistic'

U-statistic.

VSTAT = 'V-statistic'

V-statistic.

compute_indices(outputs=(), statistic_estimator=StatisticEstimator.USTAT, input_covariance_model=CovarianceModel.GAUSSIAN, output_covariance_model=CovarianceModel.GAUSSIAN, analysis_type=AnalysisType.GLOBAL)[source]

Compute the sensitivity indices.

Parameters:
  • outputs (str | Sequence[str]) –

    The output(s) for which to display the sensitivity indices. If None, use the default outputs set at instantiation.

    By default it is set to ().

  • statistic_estimator (StatisticEstimator) –

    The name of statistic estimator type.

    By default it is set to “U-statistic”.

  • input_covariance_model (CovarianceModel) –

    The name of covariance model class of the estimator associated to the input variables.

    By default it is set to “Gaussian”.

  • output_covariance_model (CovarianceModel) –

    The name of covariance model class of the estimator associated to the output variables.

    By default it is set to “Gaussian”.

  • analysis_type (AnalysisType) –

    The sensitivity analysis type.

    By default it is set to “global”.

Returns:

The sensitivity indices.

With the following structure:

{
    "method_name": {
        "output_name": [
            {
                "input_name": data_array,
            }
        ]
    }
}

Return type:

dict[str, FirstOrderIndicesType]

DEFAULT_DRIVER: ClassVar[str] = 'OT_MONTE_CARLO'
dataset: IODataset

The dataset containing the discipline evaluations.

default_output: Iterable[str]

The default outputs of interest.

property hsic: dict[str, list[dict[str, ndarray]]]

The HSIC indices.

With the following structure:

{
    "output_name": [
        {
            "input_name": data_array,
        }
    ]
}
property r2_hsic: dict[str, list[dict[str, ndarray]]]

The normalized HSIC indices.

With the following structure:

{
    "output_name": [
        {
            "input_name": data_array,
        }
    ]
}