.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/uncertainty/statistics/plot_emp_stats.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_examples_uncertainty_statistics_plot_emp_stats.py: Empirical estimation of statistics ================================== In this example, we want to empirically estimate statistics associated with the range of the Mission discipline of the Sobieski's SSBJ problem. For simplification, we use uniform distributions for the discipline inputs based on the bounds of the design parameters. .. GENERATED FROM PYTHON SOURCE LINES 33-43 .. code-block:: default from __future__ import annotations from gemseo.api import configure_logger from gemseo.api import create_discipline from gemseo.api import create_scenario from gemseo.problems.sobieski.core.problem import SobieskiProblem from gemseo.uncertainty.api import create_statistics configure_logger() .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 44-52 Create the dataset ------------------ First of all, we create the dataset. For that, we instantiate the discipline :class:`~gems.problems.sobieski.disciplines.SobieskiMission` of the Sobieski's SSBJ problem which is known to |g|. .. GENERATED FROM PYTHON SOURCE LINES 52-54 .. code-block:: default discipline = create_discipline("SobieskiMission") .. GENERATED FROM PYTHON SOURCE LINES 55-60 Then, we load the design space of the Sobieski's SSBJ problem by means of the property :meth:`.SobieskiProblem.design_space` and :meth:`.DesignSpace.filter` the inputs of the discipline :class:`~gems.problems.sobieski.disciplines.SobieskiMission`. .. GENERATED FROM PYTHON SOURCE LINES 60-63 .. code-block:: default parameter_space = SobieskiProblem().design_space parameter_space.filter(discipline.get_input_data_names()) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 64-68 Then, we sample the discipline over this design space by means of a :class:`.DOEScenario` executed with a Monte Carlo algorithm and 100 samples. .. GENERATED FROM PYTHON SOURCE LINES 68-73 .. code-block:: default scenario = create_scenario( [discipline], "DisciplinaryOpt", "y_4", parameter_space, scenario_type="DOE" ) scenario.execute({"algo": "OT_MONTE_CARLO", "n_samples": 100}) .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 14:48:28: INFO - 14:48:28: *** Start DOEScenario execution *** INFO - 14:48:28: DOEScenario INFO - 14:48:28: Disciplines: SobieskiMission INFO - 14:48:28: MDO formulation: DisciplinaryOpt INFO - 14:48:28: Optimization problem: INFO - 14:48:28: minimize y_4(x_shared, y_14, y_24, y_34) INFO - 14:48:28: with respect to x_shared, y_14, y_24, y_34 INFO - 14:48:29: over the design space: INFO - 14:48:29: +-------------+-------------+---------------+-------------+-------+ INFO - 14:48:29: | name | lower_bound | value | upper_bound | type | INFO - 14:48:29: +-------------+-------------+---------------+-------------+-------+ INFO - 14:48:29: | x_shared[0] | 0.01 | 0.05 | 0.09 | float | INFO - 14:48:29: | x_shared[1] | 30000 | 45000 | 60000 | float | INFO - 14:48:29: | x_shared[2] | 1.4 | 1.6 | 1.8 | float | INFO - 14:48:29: | x_shared[3] | 2.5 | 5.5 | 8.5 | float | INFO - 14:48:29: | x_shared[4] | 40 | 55 | 70 | float | INFO - 14:48:29: | x_shared[5] | 500 | 1000 | 1500 | float | INFO - 14:48:29: | y_14[0] | 24850 | 50606.9741711 | 77100 | float | INFO - 14:48:29: | y_14[1] | -7700 | 7306.20262124 | 45000 | float | INFO - 14:48:29: | y_24 | 0.44 | 4.15006276 | 11.13 | float | INFO - 14:48:29: | y_34 | 0.44 | 1.10754577 | 1.98 | float | INFO - 14:48:29: +-------------+-------------+---------------+-------------+-------+ INFO - 14:48:29: Solving optimization problem with algorithm OT_MONTE_CARLO: INFO - 14:48:29: ... 0%| | 0/100 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_emp_stats.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_