.. 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 Click :ref:`here ` 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 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:: default from __future__ import print_function from openturns.usecases import ishigami_function as 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:: default 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:: default distribution = im.distributionX .. GENERATED FROM PYTHON SOURCE LINES 42-43 and the Ishigami function : .. GENERATED FROM PYTHON SOURCE LINES 43-46 .. code-block:: default model = im.model .. GENERATED FROM PYTHON SOURCE LINES 47-55 .. code-block:: default 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:: default print('First order FAST indices:', firstOrderIndices) print('Total order FAST indices:', totalOrderIndices) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none First order FAST indices: [0.30764,0.442196,1.01615e-05] Total order FAST indices: [0.547254,0.487458,0.239258] .. GENERATED FROM PYTHON SOURCE LINES 61-65 .. code-block:: default 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 66-71 .. code-block:: default 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 .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.120 seconds) .. _sphx_glr_download_auto_reliability_sensitivity_sensitivity_analysis_plot_sensitivity_fast.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_fast.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_sensitivity_fast.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_