MauntzKucherenkoSensitivityAlgorithm

(Source code, png, hires.png, pdf)

../../_images/MauntzKucherenkoSensitivityAlgorithm.png
class MauntzKucherenkoSensitivityAlgorithm(*args)

Sensitivity analysis using MauntzKucherenko method.

Available constructors:

MauntzKucherenkoSensitivityAlgorithm(inputDesign, outputDesign, N)

MauntzKucherenkoSensitivityAlgorithm(distribution, N, model, computeSecondOrder)

MauntzKucherenkoSensitivityAlgorithm(experiment, model, computeSecondOrder)

Parameters:
inputDesign : Sample

Design for the evaluation of sensitivity indices, obtained thanks to the SobolIndicesAlgorithmImplementation.Generate method

outputDesign : Sample

Design for the evaluation of sensitivity indices, obtained as the evaluation of a Function (model) on the previous inputDesign

distribution : Distribution

Input probabilistic model. Should have independent copula

experiment : WeightedExperiment

Experiment for the generation of two independent samples.

N : int

Size of samples to generate

computeSecondOrder : bool

If True, design that will be generated contains elements for the evaluation of second order indices.

Notes

This class is concerned with analyzing the influence the random vector \vect{X} = \left( X^1, \ldots, X^{n_X} \right) has on a random variable Y^k which is being studied for uncertainty, by using the [sobol2007] method for the evaluation of both first and total order indices.

These last ones are respectively given as follows:

\begin{array}{ccc}
\hat{V_i} & = & \frac{1}{n} \sum_{k=1}^{n} G(B_k) \left( G(E_k) - G(A_k) \right) \\
\hat{V_{-i}} & = & \frac{1}{n} \sum_{k=1}^{n} G(A_k) \left( G(A_k) -  G(E_k) \right)
\end{array}

The variance of the estimator is computed using:

\begin{array}{ccc}
U_i = \left(\textsuperscript{c}Y_i^B \left(\textsuperscript{c}Y_i^E - \textsuperscript{c}Y_i^A \right), \left(\textsuperscript{c}Y_i^{A}\right)^2 \right)^T \\
\Psi_i(x, y) = \frac{x}{y}
\end{array}

\begin{array}{ccc}
U_{-i} = \left(\textsuperscript{c}Y_i^A \left(\textsuperscript{c}Y_i^A - \textsuperscript{c}Y_i^E \right), \left(\textsuperscript{c}Y_i^{A}\right)^2 \right)^T \\
\Psi_{-i}(x, y) = 1 - \frac{x}{y}
\end{array}

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> formula = ['sin(pi_*X1)+7*sin(pi_*X2)*sin(pi_*X2)+' + \
...    '0.1*((pi_*X3)*(pi_*X3)*(pi_*X3)*(pi_*X3))*sin(pi_*X1)']
>>> model = ot.SymbolicFunction(['X1', 'X2', 'X3'], formula)
>>> distribution = ot.ComposedDistribution([ot.Uniform(-1.0, 1.0)] * 3, \
...                                         ot.IndependentCopula(3))
>>> # Define designs to pre-compute
>>> size = 100
>>> inputDesign = ot.SobolIndicesExperiment(distribution, size, True).generate()
>>> outputDesign = model(inputDesign)
>>> # sensitivity analysis algorithm
>>> sensitivityAnalysis = ot.MauntzKucherenkoSensitivityAlgorithm(inputDesign, outputDesign, size)
>>> print(sensitivityAnalysis.getFirstOrderIndices())
[0.182219,0.357106,-0.129096]
Attributes:
thisown

The membership flag

Methods

DrawCorrelationCoefficients(*args) Draw the correlation coefficients.
DrawImportanceFactors(*args) Draw the importance factors.
DrawSobolIndices(inputDescription, …) Draw the Sobol’ indices.
draw(*args) Draw sensitivity indices.
getAggregatedFirstOrderIndices() Get the evaluation of aggregated first order Sobol indices.
getAggregatedTotalOrderIndices() Get the evaluation of aggregated total order Sobol indices.
getBootstrapSize() Get the number of bootstrap sampling size.
getClassName() Accessor to the object’s name.
getConfidenceLevel() Get the confidence interval level for confidence intervals.
getFirstOrderIndices([marginalIndex]) Get first order Sobol indices.
getFirstOrderIndicesDistribution() Get the distribution of the aggregated first order Sobol indices.
getFirstOrderIndicesInterval() Get interval for the aggregated first order Sobol indices.
getId() Accessor to the object’s id.
getName() Accessor to the object’s name.
getSecondOrderIndices([marginalIndex]) Get second order Sobol indices.
getShadowedId() Accessor to the object’s shadowed id.
getTotalOrderIndices([marginalIndex]) Get total order Sobol indices.
getTotalOrderIndicesDistribution() Get the distribution of the aggregated total order Sobol indices.
getTotalOrderIndicesInterval() Get interval for the aggregated total order Sobol indices.
getUseAsymptoticDistribution() Select asymptotic or bootstrap confidence intervals.
getVisibility() Accessor to the object’s visibility state.
hasName() Test if the object is named.
hasVisibleName() Test if the object has a distinguishable name.
setBootstrapSize(bootstrapSize) Set the number of bootstrap sampling size.
setConfidenceLevel(confidenceLevel) Set the confidence interval level for confidence intervals.
setDesign(inputDesign, outputDesign, size) Sample accessor.
setName(name) Accessor to the object’s name.
setShadowedId(id) Accessor to the object’s shadowed id.
setUseAsymptoticDistribution(…) Select asymptotic or bootstrap confidence intervals.
setVisibility(visible) Accessor to the object’s visibility state.
__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

static DrawCorrelationCoefficients(*args)
Draw the correlation coefficients.
As correlation coefficients are considered, values might be positive or negative.
Available usages:

DrawCorrelationCoefficients(correlationCoefficients, title=’Correlation coefficients’)

DrawCorrelationCoefficients(values, names, title=’Correlation coefficients’)

Parameters:
correlationCoefficients : PointWithDescription

Sequence containing the correlation coefficients with a description for each component. The descriptions are used to build labels for the created graph. If they are not mentioned, default labels will be used.

values : sequence of float

Correlation coefficients.

names : sequence of str

Variables’ names used to build labels for the created the graph.

title : str

Title of the graph.

Returns:
Graph : Graph

A graph containing a Cloud and a Text of the correlation coefficients.

static DrawImportanceFactors(*args)

Draw the importance factors.

Available usages:

DrawImportanceFactors(importanceFactors, title=’Importance Factors’)

DrawImportanceFactors(values, names, title=’Importance Factors’)

Parameters:
importanceFactors : PointWithDescription

Sequence containing the importance factors with a description for each component. The descriptions are used to build labels for the created Pie. If they are not mentioned, default labels will be used.

values : sequence of float

Importance factors.

names : sequence of str

Variables’ names used to build labels for the created Pie.

title : str

Title of the graph.

Returns:
Graph : Graph

A graph containing a Pie of the importance factors of the variables.

static DrawSobolIndices(inputDescription, firstOrderIndices, secondOrderIndices)

Draw the Sobol’ indices.

Parameters:
inputDescription : sequence of str

Variable names

firstOrderIndices : sequence of float

First order indices values

secondOrderIndices : sequence of float

Total order indices values

Returns:
Graph : Graph

For each variable, draws first and total indices

draw(*args)

Draw sensitivity indices.

Usage:

draw()

draw(marginalIndex)

With the first usage, draw the aggregated first and total order indices. With the second usage, draw the first and total order indices of a specific marginal in case of vectorial output

Parameters:
marginalIndex: int

marginal of interest (case of second usage)

Returns:
Graph : Graph

A graph containing the aggregated first and total order indices.

Notes

If number of bootstrap sampling is not 0, and confidence level associated > 0, the graph includes confidence interval plots in the first usage.

getAggregatedFirstOrderIndices()

Get the evaluation of aggregated first order Sobol indices.

Returns:
indices : Point

Sequence containing aggregated first order Sobol indices.

getAggregatedTotalOrderIndices()

Get the evaluation of aggregated total order Sobol indices.

Returns:
indices : Point

Sequence containing aggregated total order Sobol indices.

getBootstrapSize()

Get the number of bootstrap sampling size.

Returns:
bootstrapSize : int

Number of bootsrap sampling

getClassName()

Accessor to the object’s name.

Returns:
class_name : str

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

getConfidenceLevel()

Get the confidence interval level for confidence intervals.

Returns:
confidenceLevel : float

Confidence level for confidence intervals

getFirstOrderIndices(marginalIndex=0)

Get first order Sobol indices.

Parameters:
i : int, optional

Index of the marginal of the function, equals to 0 by default.

Returns:
indices : Point

Sequence containing first order Sobol indices.

getFirstOrderIndicesDistribution()

Get the distribution of the aggregated first order Sobol indices.

Returns:
distribution : Distribution

Distribution for first order Sobol indices for each component.

getFirstOrderIndicesInterval()

Get interval for the aggregated first order Sobol indices.

Returns:
interval : Interval

Interval for first order Sobol indices for each component. Computed marginal by marginal (not from the joint distribution).

getId()

Accessor to the object’s id.

Returns:
id : int

Internal unique identifier.

getName()

Accessor to the object’s name.

Returns:
name : str

The name of the object.

getSecondOrderIndices(marginalIndex=0)

Get second order Sobol indices.

Parameters:
i : int, optional

Index of the marginal of the function, equals to 0 by default.

Returns:
indices : SymmetricMatrix

Tensor containing second order Sobol indices.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
id : int

Internal unique identifier.

getTotalOrderIndices(marginalIndex=0)

Get total order Sobol indices.

Parameters:
i : int, optional

Index of the marginal of the function, equals to 0 by default.

Returns:
indices : Point

Sequence containing total order Sobol indices.

getTotalOrderIndicesDistribution()

Get the distribution of the aggregated total order Sobol indices.

Returns:
distribution : Distribution

Distribution for total order Sobol indices for each component.

getTotalOrderIndicesInterval()

Get interval for the aggregated total order Sobol indices.

Returns:
interval : Interval

Interval for total order Sobol indices for each component. Computed marginal by marginal (not from the joint distribution).

getUseAsymptoticDistribution()

Select asymptotic or bootstrap confidence intervals.

Returns:
useAsymptoticDistribution : bool

Whether to use bootstrap or asymptotic intervals

getVisibility()

Accessor to the object’s visibility state.

Returns:
visible : bool

Visibility flag.

hasName()

Test if the object is named.

Returns:
hasName : bool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleName : bool

True if the name is not empty and not the default one.

setBootstrapSize(bootstrapSize)

Set the number of bootstrap sampling size.

Default value is 0.

Parameters:
bootstrapSize : int

Number of bootsrap sampling

setConfidenceLevel(confidenceLevel)

Set the confidence interval level for confidence intervals.

Parameters:
confidenceLevel : float

Confidence level for confidence intervals

setDesign(inputDesign, outputDesign, size)

Sample accessor.

Parameters:
inputDesign : Sample

Design for the evaluation of sensitivity indices, obtained thanks to the SobolIndicesAlgorithmImplementation.Generate method

outputDesign : Sample

Design for the evaluation of sensitivity indices, obtained as the evaluation of a Function (model) on the previous inputDesign

N : int

Size of samples to generate

setName(name)

Accessor to the object’s name.

Parameters:
name : str

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:
id : int

Internal unique identifier.

setUseAsymptoticDistribution(useAsymptoticDistribution)

Select asymptotic or bootstrap confidence intervals.

Default value is set by the SobolIndicesAlgorithm-DefaultUseAsymptoticDistribution key.

Parameters:
useAsymptoticDistribution : bool

Whether to use bootstrap or asymptotic intervals

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:
visible : bool

Visibility flag.

thisown

The membership flag