Correlations#

In this example, we illustrate the use of the Correlations post-processing on the Sobieski's SSBJ problem.

A correlation coefficient indicates whether there is a linear relationship between two quantities \(x\) and \(y\). It is the normalized covariance between the two quantities defined as:

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

  • 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
  • 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
    INFO - 16:25:43: Importing the optimization problem from the file sobieski_mdf_scenario.h5
    INFO - 16:25:43: Detected 37 correlations > 0.95

<gemseo.post.correlations.Correlations object at 0x72a4d89b7e90>

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,
    ),
)

Total running time of the script: (0 minutes 1.417 seconds)

Gallery generated by Sphinx-Gallery