DataSensitivityAnalysis

class persalys.DataSensitivityAnalysis(*args)

Perform a sensitivity analysis on a design of experiments. see openturns.experimental.RankSobolSensitivityAlgorithm for more details.

Parameters:
namestr

Name of the analysis.

designDesignOfExperiment

Design of experiments to analyze.

typeint, optional

Type of sensitivity analysis to perform, encoded in a byte with : - persalys.DataSensitivityAnalysisResult.RankSobol for Rank Sobol indices - persalys.DataSensitivityAnalysisResult.SRC for SRC indices - persalys.DataSensitivityAnalysisResult.GlobalHSIC for global HSIC indices - persalys.DataSensitivityAnalysisResult.TargetHSIC for target HSIC indices - persalys.DataSensitivityAnalysisResult.ConditionalHSIC for conditional HSIC indices The default value is RankSobol | SRC (Rank Sobol and SRC indices are computed by default).

interestVariablesDescription, optional

Description of the variables of interest for the sensitivity analysis. The variables of interest must be a subset of the output variables in the design of experiment. If not provided, all output variables will be considered as variables of interest.

Methods

computeAsymptoticPValues(hsicType)

Whether to compute asymptotic p-values for HSIC indices of the given type.

computeCovModelParameters(...)

Set whether the parameters of the covariance models should be estimated from the data.

computeHSIC(hsicType)

Whether to compute HSIC indices of the given type.

computePermutationPValues(hsicType)

Whether to compute permutation p-values for HSIC indices of the given type.

computeRankSobol()

Whether to compute Rank Sobol indices.

computeSRC()

Whether to compute SRC indices.

defaultHSICParametersChanged()

Whether the default parameters for HSIC indices computation have been changed.

getClassName()

Accessor to the object's name.

getConditionalCriticalDomain()

Get the critical domain for conditional HSIC sensitivity analyses.

getCovarianceModels(hsicType)

Get the covariance models used for the computation of HSIC indices.

getDesignOfExperiment()

Design of experiments accessor.

getErrorMessage()

Error message accessor.

getFilterAlphas()

Get the alpha parameters for the target HSIC filter functions.

getFilterFunctions()

Get the filter functions for the target HSIC indices computation.

getInterestVariables()

Get the variables to analyse.

getName()

Accessor to the object's name.

getPythonScript()

Physical model accessor.

getResult()

Get the result of the sensitivity analysis.

getTargetCriticalDomain()

Get the critical domain for target HSIC sensitivity analyses.

getWarningMessage()

Warning message accessor.

getWeightAlphas()

Get the alpha parameters for the conditional HSIC weight functions.

getWeightFunctions()

Get the weight functions for the conditional HSIC indices computation.

hasName()

Test if the object is named.

hasValidResult()

Whether the analysis has been run.

isReliabilityAnalysis()

Whether the analysis involves reliability.

isRunning()

Whether the analysis is running.

run()

Launch the analysis.

setCovarianceModels(covarianceModels, hsicType)

Set the covariance models used for the computation of HSIC indices.

setFilterAlphas(filterAlphas, criticalDomain)

Set the alpha parameters for the target HSIC filter functions.

setFilterFunctions(filterFunctions)

Set the filter functions for the target HSIC indices computation.

setHSICParameters(computePermutationPValues, ...)

Set the parameters for the HSIC indices computation.

setInterestVariables(variablesNames)

Set the variables to analyse.

setName(name)

Accessor to the object's name.

setType(analysisType)

Set the type of sensitivity analysis to perform.

setWeightAlphas(weightAlphas, criticalDomain)

Set the alpha parameters for the conditional HSIC weight functions.

setWeightFunctions(weightFunctions)

Set the weight functions for the conditional HSIC indices computation.

useUStatistic(hsicType)

Whether to use the U-statistic for the computation of HSIC indices.

Examples

>>> import openturns as ot
>>> import persalys
>>> from openturns.usecases import ishigami_function

Create the csv:

>>> im = ishigami_function.IshigamiModel()
>>> x = im.inputDistribution.getSample(100)
>>> y = im.model(x)
>>> data_sample = x
>>> data_sample.stack(y)
>>> data_sample.exportToCSVFile('data.csv')

Create the model:

>>> importedDataset = persalys.ImportedDataset('data.csv', [0, 1, 2], [3])
>>> model = persalys.DataModel('myDataModel', importedDataset)

Create and run the analysis:

>>> analysis = persalys.DataSensitivityAnalysis('sensitivity', model, persalys.DataSensitivityAnalysisResult.RankSobol | persalys.DataSensitivityAnalysisResult.SRC)
>>> analysis.run()

Get the result:

>>> result = analysis.getResult()
>>> if result.isIndependent():
...    # The inputs need to be independant for the result to be valid
...    firstOrderIndices = result.getFirstOrderIndices()
...    firstOrderIndicesInterval = result.getFirstOrderIndicesInterval()
... else:
...    independenceWarning = result.getIndependenceWarningMessage()
__init__(*args)
computeAsymptoticPValues(hsicType)

Whether to compute asymptotic p-values for HSIC indices of the given type.

Parameters:
hsicTypeint

Type of HSIC indices (Global, Target or Conditional).

Returns:
computebool

True if asymptotic p-values will be computed, false otherwise.

computeCovModelParameters(computeCovModelParameters)

Set whether the parameters of the covariance models should be estimated from the data.

Parameters:
computeCovModelParametersbool

If true, the scale parameters of the covariance models will be set to the standard deviation of the corresponding variable in the design of experiment. If false, the covariance models parameters will not be changed. True by default.

computeHSIC(hsicType)

Whether to compute HSIC indices of the given type.

Parameters:
hsicTypeint

Type of HSIC indices (Global, Target or Conditional).

Returns:
computebool

True if HSIC indices of the given type will be computed, false otherwise.

computePermutationPValues(hsicType)

Whether to compute permutation p-values for HSIC indices of the given type.

Parameters:
hsicTypeint

Type of HSIC indices (Global, Target or Conditional).

Returns:
computebool

True if permutation p-values will be computed, false otherwise.

computeRankSobol()

Whether to compute Rank Sobol indices.

Returns:
computebool

True if Rank Sobol indices will be computed, false otherwise.

computeSRC()

Whether to compute SRC indices.

Returns:
computebool

True if SRC indices will be computed, false otherwise.

defaultHSICParametersChanged()

Whether the default parameters for HSIC indices computation have been changed.

Returns:
changedbool

True if the default parameters for HSIC indices computation have been changed, false otherwise.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getConditionalCriticalDomain()

Get the critical domain for conditional HSIC sensitivity analyses.

Returns:
criticalDomainInterval

The critical domain interval. Empty if no critical domain has been set.

getCovarianceModels(hsicType)

Get the covariance models used for the computation of HSIC indices.

Parameters:
hsicTypeint

Type of HSIC indices (Global, Target or Conditional).

Returns:
covarianceModelscollection of CovarianceModel

Collection of covariance models used for the computation of HSIC indices.

getDesignOfExperiment()

Design of experiments accessor.

Returns:
modelDesignOfExperiment

Design of experiments

getErrorMessage()

Error message accessor.

Returns:
messagestr

Error message if the analysis failed

getFilterAlphas()

Get the alpha parameters for the target HSIC filter functions.

Returns:
filterAlphasPoint

Alpha parameters for each output variable of interest. Empty if filter functions were set directly.

getFilterFunctions()

Get the filter functions for the target HSIC indices computation.

Returns:
filterFunctionscollection of Function

Collection of filter functions. May be empty if filter alphas were set and the analysis has not been launched yet.

getInterestVariables()

Get the variables to analyse.

Returns:
variablesNamessequence of str

Names of the variables to analyse

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getPythonScript()

Physical model accessor.

Returns:
scriptstr

Python script to replay the analysis

getResult()

Get the result of the sensitivity analysis.

Returns:
resultDataSensitivityAnalysisResult

Result of the sensitivity analysis.

getTargetCriticalDomain()

Get the critical domain for target HSIC sensitivity analyses.

Returns:
criticalDomainInterval

The critical domain interval. Empty if no critical domain has been set.

getWarningMessage()

Warning message accessor.

Returns:
messagestr

Warning message which can appear during the analysis computation

getWeightAlphas()

Get the alpha parameters for the conditional HSIC weight functions.

Returns:
weightAlphasPoint

Alpha parameters for each output variable of interest. Empty if weight functions were set directly.

getWeightFunctions()

Get the weight functions for the conditional HSIC indices computation.

Returns:
weightFunctionscollection of Function

Collection of weight functions. May be empty if weight alphas were set and the analysis has not been launched yet.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

hasValidResult()

Whether the analysis has been run.

Returns:
hasValidResultbool

Whether the analysis has already been run

isReliabilityAnalysis()

Whether the analysis involves reliability.

Returns:
isReliabilityAnalysisbool

Whether the analysis involves a reliability analysis

isRunning()

Whether the analysis is running.

Returns:
isRunningbool

Whether the analysis is running

run()

Launch the analysis.

setCovarianceModels(covarianceModels, hsicType)

Set the covariance models used for the computation of HSIC indices.

Parameters:
covarianceModelscollection of CovarianceModel

Collection of covariance models to use for the computation of HSIC indices. The size of the collection must be equal to the total number of input and output variables in the design of experiment.

hsicTypeint

Type of HSIC indices (Global, Target or Conditional).

setFilterAlphas(filterAlphas, criticalDomain)

Set the alpha parameters for the target HSIC filter functions.

The filter functions are constructed as y \mapsto \exp(-d(y, D) / (\alpha_i \cdot \sigma_i)) where \alpha_i is the alpha parameter, \sigma_i is the standard deviation of the i-th output variable and d(y, D) is the distance from y to the critical domain D. Setting alphas clears any previously set filter functions.

Parameters:
filterAlphasPoint

Alpha parameters for each output variable of interest. The size must be equal to the number of output variables of interest.

criticalDomainInterval

Critical domain for the sensitivity analysis. The distance to this domain will be used to construct the filter functions. The dimension of the interval must be equal to the number of output variables of interest.

setFilterFunctions(filterFunctions)

Set the filter functions for the target HSIC indices computation.

Setting filter functions directly clears any previously set filter alphas. For most use cases, prefer setFilterAlphas() which allows the analysis to construct the functions automatically.

Parameters:
filterFunctionscollection of Function

Collection of filter functions to use for the computation of target HSIC indices. The size of the collection must be equal to the number of output variables of interest.

setHSICParameters(computePermutationPValues, computeAsymptoticPValues, useUStatistic, hsicType)

Set the parameters for the HSIC indices computation.

Parameters:
computePermutationPValuesbool

Whether to compute permutation p-values.

computeAsymptoticPValuesbool

Whether to compute asymptotic p-values.

useUStatisticbool

Whether to use the U-statistic for the computation. If false, the V-statistic will be used.

hsicTypeint

Type of HSIC indices (Global, Target or Conditional). For Conditional, asymptotic p-values and U-statistic are not supported and will be ignored.

setInterestVariables(variablesNames)

Set the variables to analyse.

Parameters:
variablesNamessequence of str

Names of the variables to analyse

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setType(analysisType)

Set the type of sensitivity analysis to perform.

Parameters:
analysisTypeint

Type of sensitivity analysis to perform, encoded in a byte with :

- persalys.DataSensitivityAnalysis.RankSobol for Rank Sobol indices
- persalys.DataSensitivityAnalysis.SRC for SRC indices
- persalys.DataSensitivityAnalysis.GlobalHSIC for global HSIC indices
- persalys.DataSensitivityAnalysis.TargetHSIC for target HSIC indices
- persalys.DataSensitivityAnalysis.ConditionalHSIC for conditional HSIC indices
setWeightAlphas(weightAlphas, criticalDomain)

Set the alpha parameters for the conditional HSIC weight functions.

The weight functions are constructed as y \mapsto \exp(-d(y, D) / (\alpha_i \cdot \sigma_i)) where \alpha_i is the alpha parameter, \sigma_i is the standard deviation of the i-th output variable and d(y, D) is the distance from y to the critical domain D. Setting alphas clears any previously set weight functions.

Parameters:
weightAlphasPoint

Alpha parameters for each output variable of interest. The size must be equal to the number of output variables of interest.

criticalDomainInterval

Critical domain for the sensitivity analysis. The distance to this domain will be used to construct the weight functions. The dimension of the interval must be equal to the number of output variables of interest.

setWeightFunctions(weightFunctions)

Set the weight functions for the conditional HSIC indices computation.

Setting weight functions directly clears any previously set weight alphas. For most use cases, prefer setWeightAlphas() which allows the analysis to construct the functions automatically.

Parameters:
weightFunctionscollection of Function

Collection of weight functions to use for the computation of conditional HSIC indices. The size of the collection must be equal to the number of output variables of interest.

useUStatistic(hsicType)

Whether to use the U-statistic for the computation of HSIC indices.

Parameters:
hsicTypeint

Type of HSIC indices (Global, Target or Conditional).

Returns:
useUStatisticbool

True if the U-statistic will be used, false if the V-statistic will be used.