Note
Go to the end to download the full example code.
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.
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)

