SensitivityConvergence

class SensitivityConvergence(problem, metaSAAlgorithm, numberOfExperiments=1000, numberOfRepetitions=10, maximum_elapsed_time=5.0, sample_size_initial=20, estimator='Saltelli', sampling_method='MonteCarlo', use_sampling=True, total_degree=2, hyperbolic_quasinorm=0.5, graphical_epsilon=4.440892098500626e-16)

Methods

computeError(sample_size)

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, maximum_elapsed_time=5.0, sample_size_initial=20, estimator='Saltelli', sampling_method='MonteCarlo', use_sampling=True, total_degree=2, hyperbolic_quasinorm=0.5, graphical_epsilon=4.440892098500626e-16)

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 repetions for a given sample size. The numberOfRepetitions attribute sets the number of vertical points in each graph.

maximum_elapsed_timefloat

The maximum number of seconds in the simulation.

sample_size_initialint

The initial sample size.

estimatorstr

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

sampling_methodstr

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

use_samplingbool

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

total_degreeint

The total degree of the polynomial chaos.

hyperbolic_quasinormfloat

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

graphical_epsilonfloat

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.

computeError(sample_size)

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:

AE(i) = abs(S_computed(i) - S_reference(i))

for i = 1, …, p where p is the dimension of the problem.

Parameters:
sample_size: int

The sample size.

Returns:
first_order_AEot.Point(dimension)

The AE of the first order Sobol’ indices.

total_order_AEot.Point(dimension)

The AE of the total order Sobol’ indices.

computeSobolSample(verbose=False)

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:
sample_size_tableot.Sample(number_of_experiments, 1)

The sample size of each experiment.

first_order_tableot.Sample(number_of_experiments, dimension)

The AE of the first order Sobol’ indices.

total_order_tableot.Sample(number_of_experiments, 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. 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

If True, then prints intermediate messages.

Returns:
sample_size_tableot.Sample(number_of_experiments, 1)

The sample size of each experiment.

first_order_tableot.Sample(number_of_experiments, dimension)

The AE of the first order Sobol’ indices.

total_order_tableot.Sample(number_of_experiments, dimension)

The AE of the total order Sobol’ indices.

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. 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

If True, then prints intermediate messages.

Returns:
gridot.GridLayout

The grid of convergence Graphs.