SensitivityConvergence

class SensitivityConvergence(problem, metaSAAlgorithm, numberOfExperiments=1000, numberOfRepetitions=10, maximumElapsedTime=5.0, sampleSizeInitial=20, estimator='Saltelli', samplingMethod='MonteCarlo', useSampling=True, totalDegree=2, hyperbolicQuasiNorm=0.5, graphicalEpsilon=4.440892098500626e-16, sampleSizeFactor=2.0, sparse=True)

Methods

computeError(sampleSize)

Compute the absolute error for the problem with Monte-Carlo sample.

computeSobolSample([verbose])

Repeat increasingly large Monte-Carlo Sobol' experiments.

plotConvergenceCurve([verbose])

Plot increasingly large Monte-Carlo Sobol' experiments.

plotConvergenceGrid([verbose])

Plot increasingly large Monte-Carlo Sobol' experiments.

__init__(problem, metaSAAlgorithm, numberOfExperiments=1000, numberOfRepetitions=10, maximumElapsedTime=5.0, sampleSizeInitial=20, estimator='Saltelli', samplingMethod='MonteCarlo', useSampling=True, totalDegree=2, hyperbolicQuasiNorm=0.5, graphicalEpsilon=4.440892098500626e-16, sampleSizeFactor=2.0, sparse=True)

Create a meta-algorithm to benchmark a sensitivity problem.

Parameters:
problemot.SensitivityBenchmarkProblem

The problem.

metaSAAlgorithmSensitivityBenchmarkMetaAlgorithm

A meta-sensitivity algorithm.

numberOfExperimentsint

Number of atomic experiments, i.e. the number of times the sample size increases. The default is set to a very large value, so that the algorithm stops depending on the elapsed time criteria.

numberOfRepetitionsint

Number of repetitions for a given sample size. The numberOfRepetitions attribute sets the number of vertical points in each graph.

maximumElapsedTimefloat

The maximum number of seconds in the simulation.

sampleSizeInitialint

The initial sample size.

estimatorstr

The estimator. Must be “Saltelli”, “Jansen”, “Martinez”, “MauntzKucherenko”, “Janon”.

samplingMethodstr

The sampling method. Must be “MonteCarlo” or “LHS” or “QMC”.

useSamplingbool

Set to True to use sampling methods. Set to False to use polynomial chaos.

totalDegreeint

The total degree of the polynomial chaos.

hyperbolicQuasiNormfloat

The quasi-norm of the enumeration rule of the polynomial chaos.

graphicalEpsilonfloat

The value which is set as the minimum absolute error of Sobol’ indices. This allows to use logarithmic scale even if the absolute error is exactly zero.

sampleSizeFactorfloat

The factor by which the sample size is multiplied at each stage of the simulation. The default is 2.0.

sparsebool, optional

Whether to use sparse polynomial chaos. The default is True.

computeError(sampleSize)

Compute the absolute error for the problem with Monte-Carlo sample.

Uses Saltelli estimator.

For some cases, the reference Sobol’ index is zero. This is why the relative error cannot be used as a metric. We compute the absolute error between the reference Sobol’ indices and the computed Sobol’ indices:

\text{AE}_i = \left|S_{\text{computed},i} - S_{\text{reference}, i}\right|

for i \in \{1, ..., \inputDim\} where \inputDim is the dimension of the problem.

Parameters:
sampleSize: int

The sample size.

Returns:
firstOrderAEot.Point(dimension)

The AE of the first order Sobol’ indices.

totalOrderAEot.Point(dimension)

The AE of the total order Sobol’ indices.

computeSobolSample(verbose=True)

Repeat increasingly large Monte-Carlo Sobol’ experiments.

The goal of this function is to see how the Sobol’ estimator converges when the sample size increases. For each sample size, we repeat the experiment a given number of times, in order to see the variability of the estimator. At each stage of the simulation, the sample size is multiplied by 2. The number of performed simulation depends on the maximum elapsed time: when this time exceeds a given duration, the algorithm stops.

Parameters:
verbosebool

Set to True to print intermediate messages.

Returns:
sampleSizeTableot.Sample(numberOfExperiments, 1)

The sample size of each experiment.

firstOrderTableot.Sample(numberOfExperiments, dimension)

The AE of the first order Sobol’ indices.

totalOrderTableot.Sample(numberOfExperiments, dimension)

The AE of the total order Sobol’ indices.

plotConvergenceCurve(verbose=False)

Plot increasingly large Monte-Carlo Sobol’ experiments.

The goal of this function is to see how the Sobol’ estimator converges when the sample size increases. See computeSobolSample for more details.

Parameters:
verbosebool

If True, then prints intermediate messages.

Returns:
graphot.Graph

The convergence Graph.

plotConvergenceGrid(verbose=False)

Plot increasingly large Monte-Carlo Sobol’ experiments.

The goal of this function is to see how the Sobol’ estimator converges when the sample size increases. See computeSobolSample for more details.

Parameters:
verbosebool

If True, then prints intermediate messages.

Returns:
gridot.GridLayout

The grid of convergence Graphs.