[0.262063,0.403644,0.0435311]

.. code-block:: default sensitivityAnalysis.getTotalOrderIndices() .. raw:: html

[0.529997,0.441213,0.27389]

The `draw` method produces the following graph. The vertical bars represent the 95% confidence intervals of the estimates. .. code-block:: default graph = sensitivityAnalysis.draw() view = viewer.View(graph) .. image:: /auto_reliability_sensitivity/sensitivity_analysis/images/sphx_glr_plot_sensitivity_sobol_003.png :alt: Sobol' indices - SaltelliSensitivityAlgorithm :class: sphx-glr-single-img - We see that the variable :math:`X_1`, with a total Sobol' index close to 0.6, is the most significant variable, taking into account both its direct effect and its interactions with other variables. Its first order index is close to 0.3, which implies that its interactions alone produce almost 30% (0.6 - 0.3) of the total variance. - The variable :math:`X_2` has the highest first order index: approximately 0.4. However, it has little interaction with other variables since its total order indice is close to its first order index. - The variable :math:`X_3` has a first order index close to zero. However, it has an impact to the total variance thanks to its interactions with :math:`X_1`. - We see that the variability of the estimates is quite high even with a relatively large sample size. Moreover, since the exact first order Sobol' index for :math:`X_3` is zero, its estimate has a 50% chance of being nonpositive. Estimate the second order indices --------------------------------- .. code-block:: default size = 1000 computeSecondOrder = True sie = ot.SobolIndicesExperiment(im.distributionX, size, computeSecondOrder) inputDesign = sie.generate() print(inputDesign.getSize()) inputDesign.setDescription(input_names) outputDesign = im.model(inputDesign) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none 8000 We see that 8000 function evaluations are now required; that is 3000 more evaluations than in the previous situation. .. code-block:: default sensitivityAnalysis = ot.SaltelliSensitivityAlgorithm(inputDesign, outputDesign, size) .. code-block:: default second_order = sensitivityAnalysis.getSecondOrderIndices() for i in range(im.dim): for j in range(i): print('2nd order indice (%d,%d)=%g' % (i,j,second_order[i,j])) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none 2nd order indice (1,0)=0.0120302 2nd order indice (2,0)=0.217984 2nd order indice (2,1)=0.0590756 This shows that the only significant interaction is the one between :math:`X_1` and :math:`X_3` (beware of Python's index shift: 0 denotes the first input variable). Using a different estimator --------------------------- We have used the `SaltelliSensitivityAlgorithm` class to estimate the indices. Others are available in the library: * `SaltelliSensitivityAlgorithm` * `MartinezSensitivityAlgorithm` * `JansenSensitivityAlgorithm` * `MauntzKucherenkoSensitivityAlgorithm` In order to compare the results with another method, we use the `MartinezSensitivityAlgorithm` class. .. code-block:: default sensitivityAnalysis = ot.MartinezSensitivityAlgorithm(inputDesign, outputDesign, size) .. code-block:: default graph = sensitivityAnalysis.draw() view = viewer.View(graph) plt.show() .. image:: /auto_reliability_sensitivity/sensitivity_analysis/images/sphx_glr_plot_sensitivity_sobol_004.png :alt: Sobol' indices - MartinezSensitivityAlgorithm :class: sphx-glr-single-img We see that the results do not change significantly in this particular situation. .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.511 seconds) .. _sphx_glr_download_auto_reliability_sensitivity_sensitivity_analysis_plot_sensitivity_sobol.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_sensitivity_sobol.py