.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/post_process/algorithms/plot_correlations.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_examples_post_process_algorithms_plot_correlations.py: Correlations ============ In this example, we illustrate the use of the :class:`.Correlations` post-processing on the Sobieski's SSBJ problem. A correlation coefficient indicates whether there is a linear relationship between two quantities :math:`x` and :math:`y`. It is the normalized covariance between the two quantities defined as: .. math:: R_{xy}=\frac {\sum \limits _{i=1}^n(x_i-{\bar{x}})(y_i-{\bar{y}})}{ns_{x}s_{y}} =\frac {\sum \limits _{i=1}^n(x_i-{\bar{x}})(y_i-{\bar{y}})}{\sqrt {\sum \limits _{i=1}^n(x_i-{\bar{x}})^{2}\sum \limits _{i=1}^n(y_i-{\bar{y}})^{2}}} The :class:`.Correlations` post-processing provides scatter plots of correlated variables among design variables, outputs functions, and constraints. By default, only the variables with a correlation coefficient greater than 0.95 are considered. The threshold value can be modified in the post-processing settings. .. GENERATED FROM PYTHON SOURCE LINES 44-60 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/post_process/algorithms/images/sphx_glr_plot_correlations_001.png :alt: R=-0.98093, R=0.98093, R=-0.96059, R=-0.96066, R=0.99723, R=0.96067, R=-0.99723, R=-1.00000, R=-0.96068, R=0.99723, R=1.00000, R=-1.00000, R=-0.96068, R=0.99723, R=1.00000, R=-1.00000, R=1.00000, R=-0.99817, R=0.96068, R=-0.99723, R=-1.00000, R=1.00000, R=-1.00000, R=0.96068, R=-0.99722 :srcset: /examples/post_process/algorithms/images/sphx_glr_plot_correlations_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/post_process/algorithms/images/sphx_glr_plot_correlations_002.png :alt: R=-1.00000, R=1.00000, R=-1.00000, R=-1.00000, R=1.00000, R=-0.98196, R=-0.98224, R=0.98223, R=-0.98223, R=-0.98223, R=0.98223, R=0.98223 :srcset: /examples/post_process/algorithms/images/sphx_glr_plot_correlations_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 16:25:43: Importing the optimization problem from the file sobieski_mdf_scenario.h5 INFO - 16:25:43: Detected 37 correlations > 0.95 | .. code-block:: Python from __future__ import annotations from gemseo import execute_post from gemseo.settings.post import Correlations_Settings # Correlations of the constraint `g_3`. execute_post( "sobieski_mdf_scenario.h5", settings_model=Correlations_Settings( func_names=["g_3"], coeff_limit=0.95, # Default value, here for illustration purpose. save=False, show=True, ), ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.417 seconds) .. _sphx_glr_download_examples_post_process_algorithms_plot_correlations.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_correlations.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_correlations.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_correlations.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_