.. 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-41 .. code-block:: default 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 Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 42-50 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 50-52 .. code-block:: default discipline = create_discipline("SobieskiMission") .. GENERATED FROM PYTHON SOURCE LINES 53-58 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 58-61 .. code-block:: default parameter_space = SobieskiProblem().design_space parameter_space.filter(discipline.get_input_data_names()) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 62-66 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 66-71 .. 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 Out: .. code-block:: none INFO - 10:07:17: INFO - 10:07:17: *** Start DOEScenario execution *** INFO - 10:07:17: DOEScenario INFO - 10:07:17: Disciplines: SobieskiMission INFO - 10:07:17: MDO formulation: DisciplinaryOpt INFO - 10:07:17: Optimization problem: INFO - 10:07:17: minimize y_4(x_shared, y_14, y_24, y_34) INFO - 10:07:17: with respect to x_shared, y_14, y_24, y_34 INFO - 10:07:17: over the design space: INFO - 10:07:17: +----------+-------------+---------------+-------------+-------+ INFO - 10:07:17: | name | lower_bound | value | upper_bound | type | INFO - 10:07:17: +----------+-------------+---------------+-------------+-------+ INFO - 10:07:17: | x_shared | 0.01 | 0.05 | 0.09 | float | INFO - 10:07:17: | x_shared | 30000 | 45000 | 60000 | float | INFO - 10:07:17: | x_shared | 1.4 | 1.6 | 1.8 | float | INFO - 10:07:17: | x_shared | 2.5 | 5.5 | 8.5 | float | INFO - 10:07:17: | x_shared | 40 | 55 | 70 | float | INFO - 10:07:17: | x_shared | 500 | 1000 | 1500 | float | INFO - 10:07:17: | y_14 | 24850 | 50606.9741711 | 77100 | float | INFO - 10:07:17: | y_14 | -7700 | 7306.20262124 | 45000 | float | INFO - 10:07:17: | y_24 | 0.44 | 4.15006276 | 11.13 | float | INFO - 10:07:17: | y_34 | 0.44 | 1.10754577 | 1.98 | float | INFO - 10:07:17: +----------+-------------+---------------+-------------+-------+ INFO - 10:07:17: Solving optimization problem with algorithm OT_MONTE_CARLO: INFO - 10:07:17: Generation of OT_MONTE_CARLO DOE with OpenTURNS INFO - 10:07:17: ... 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 `_