.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_reliability_sensitivity/sensitivity_analysis/plot_sensitivity_fast.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_reliability_sensitivity_sensitivity_analysis_plot_sensitivity_fast.py: FAST sensitivity indices ======================== .. GENERATED FROM PYTHON SOURCE LINES 6-24 This example will demonstrate how to quantify the correlation between the input variables and the output variable of a model using the FAST method, based upon the Fourier decomposition of the model response, which is a relevant alternative to the classical simulation approach for computing Sobol sensitivity indices. The FAST indices, like the Sobol indices, allow one to evaluate the importance of a single variable or a specific set of variables. In theory, FAST indices range is :math:`\left[0; 1\right]` ; the closer to 1 the index is, the greater the model response sensitivity to the variable is. The FAST method compute the first and total order indices. The first order indices evaluate the importance of one variable at a time (:math:`d` indices, with :math:`d` the input dimension of the model). The :math:`d` total indices give the relative importance of every variables except the variable :math:`X_i`, for every variable. .. GENERATED FROM PYTHON SOURCE LINES 26-33 .. code-block:: Python from openturns.usecases import ishigami_function import openturns as ot import openturns.viewer as viewer from matplotlib import pylab as plt ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 34-35 We load the :ref:`Ishigami model ` from the usecases module : .. GENERATED FROM PYTHON SOURCE LINES 35-37 .. code-block:: Python im = ishigami_function.IshigamiModel() .. GENERATED FROM PYTHON SOURCE LINES 38-39 The `IshigamiModel` data class contains the input independent joint distribution : .. GENERATED FROM PYTHON SOURCE LINES 39-41 .. code-block:: Python distribution = im.distributionX .. GENERATED FROM PYTHON SOURCE LINES 42-43 and the Ishigami function : .. GENERATED FROM PYTHON SOURCE LINES 43-46 .. code-block:: Python model = im.model .. GENERATED FROM PYTHON SOURCE LINES 47-55 .. code-block:: Python size = 400 sensitivityAnalysis = ot.FAST(model, distribution, size) # Compute the first order indices (first and total order indices are # computed together) firstOrderIndices = sensitivityAnalysis.getFirstOrderIndices() # Retrieve total order indices totalOrderIndices = sensitivityAnalysis.getTotalOrderIndices() .. GENERATED FROM PYTHON SOURCE LINES 56-57 Print indices .. GENERATED FROM PYTHON SOURCE LINES 57-60 .. code-block:: Python print("First order FAST indices:", firstOrderIndices) print("Total order FAST indices:", totalOrderIndices) .. rst-class:: sphx-glr-script-out .. code-block:: none First order FAST indices: [0.307822,0.443645,6.61643e-06] Total order FAST indices: [0.546652,0.487709,0.23937] .. GENERATED FROM PYTHON SOURCE LINES 61-66 .. code-block:: Python graph = ot.SobolIndicesAlgorithm.DrawImportanceFactors( firstOrderIndices, distribution.getDescription(), "FAST first order indices" ) view = viewer.View(graph) .. image-sg:: /auto_reliability_sensitivity/sensitivity_analysis/images/sphx_glr_plot_sensitivity_fast_001.png :alt: FAST first order indices :srcset: /auto_reliability_sensitivity/sensitivity_analysis/images/sphx_glr_plot_sensitivity_fast_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 67-73 .. code-block:: Python graph = ot.SobolIndicesAlgorithm.DrawImportanceFactors( totalOrderIndices, distribution.getDescription(), "FAST total order indices" ) view = viewer.View(graph) plt.show() .. image-sg:: /auto_reliability_sensitivity/sensitivity_analysis/images/sphx_glr_plot_sensitivity_fast_002.png :alt: FAST total order indices :srcset: /auto_reliability_sensitivity/sensitivity_analysis/images/sphx_glr_plot_sensitivity_fast_002.png :class: sphx-glr-single-img .. _sphx_glr_download_auto_reliability_sensitivity_sensitivity_analysis_plot_sensitivity_fast.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_sensitivity_fast.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_sensitivity_fast.py `