.. 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 36-44 .. code-block:: default from __future__ import division, unicode_literals from gemseo.api import configure_logger, create_discipline, create_scenario from gemseo.problems.sobieski.core 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 45-54 Create the dataset ------------------ First of all, we create the dataset. For that, we instantiate the discipline :class:`~gems.problems.sobieski.wrappers.SobieskiMission` of the Sobieski's SSBJ problem which is known to |g|. We update the cache policy so as to cache all data in memory. .. GENERATED FROM PYTHON SOURCE LINES 54-57 .. code-block:: default discipline = create_discipline("SobieskiMission") discipline.set_cache_policy(discipline.MEMORY_FULL_CACHE) .. GENERATED FROM PYTHON SOURCE LINES 58-63 Then, we load the design space of the Sobieski's SSBJ problem by means of the method :meth:`.SobieskiProblem.read_design_space` and :meth:`.DesignSpace.filter` the inputs of the discipline :class:`~gems.problems.sobieski.wrappers.SobieskiMission`. .. GENERATED FROM PYTHON SOURCE LINES 63-66 .. code-block:: default parameter_space = SobieskiProblem().read_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 67-71 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 71-76 .. 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 - 21:50:55: INFO - 21:50:55: *** Start DOE Scenario execution *** INFO - 21:50:55: DOEScenario INFO - 21:50:55: Disciplines: SobieskiMission INFO - 21:50:55: MDOFormulation: DisciplinaryOpt INFO - 21:50:55: Algorithm: OT_MONTE_CARLO INFO - 21:50:55: Optimization problem: INFO - 21:50:55: Minimize: y_4(x_shared, y_14, y_24, y_34) INFO - 21:50:55: With respect to: x_shared, y_14, y_24, y_34 INFO - 21:50:55: Generation of OT_MONTE_CARLO DOE with OpenTurns INFO - 21:50:55: DOE sampling: 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 `_