.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_stochastic_processes/plot_aggregated_process.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_stochastic_processes_plot_aggregated_process.py: Aggregate processes =================== .. GENERATED FROM PYTHON SOURCE LINES 7-8 In this example we are going to concatenate several processes that share the same mesh. .. GENERATED FROM PYTHON SOURCE LINES 10-13 .. code-block:: Python import openturns as ot import openturns.viewer as otv .. GENERATED FROM PYTHON SOURCE LINES 14-15 Create processes to aggregate .. GENERATED FROM PYTHON SOURCE LINES 15-24 .. code-block:: Python myMesher = ot.IntervalMesher([100, 10]) lowerbound = [0.0, 0.0] upperBound = [2.0, 4.0] myInterval = ot.Interval(lowerbound, upperBound) myMesh = myMesher.build(myInterval) myProcess1 = ot.WhiteNoise(ot.Normal(), myMesh) myProcess2 = ot.WhiteNoise(ot.Triangular(), myMesh) .. GENERATED FROM PYTHON SOURCE LINES 25-26 Draw values of a realization of the 2nd process .. GENERATED FROM PYTHON SOURCE LINES 26-30 .. code-block:: Python marginal = ot.HistogramFactory().build(myProcess1.getRealization().getValues()) graph = marginal.drawPDF() view = otv.View(graph) .. image-sg:: /auto_stochastic_processes/images/sphx_glr_plot_aggregated_process_001.svg :alt: X0 PDF :srcset: /auto_stochastic_processes/images/sphx_glr_plot_aggregated_process_001.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 31-32 Create an aggregated process .. GENERATED FROM PYTHON SOURCE LINES 32-34 .. code-block:: Python myAggregatedProcess = ot.AggregatedProcess([myProcess1, myProcess2]) .. GENERATED FROM PYTHON SOURCE LINES 35-36 Draw values of the realization on the 2nd marginal .. GENERATED FROM PYTHON SOURCE LINES 36-42 .. code-block:: Python marginal = ot.HistogramFactory().build( myAggregatedProcess.getRealization().getValues().getMarginal(0) ) graph = marginal.drawPDF() otv.View(graph) .. image-sg:: /auto_stochastic_processes/images/sphx_glr_plot_aggregated_process_002.svg :alt: X0 PDF :srcset: /auto_stochastic_processes/images/sphx_glr_plot_aggregated_process_002.svg :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 43-44 Display all figures .. GENERATED FROM PYTHON SOURCE LINES 44-45 .. code-block:: Python otv.View.ShowAll() .. _sphx_glr_download_auto_stochastic_processes_plot_aggregated_process.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_aggregated_process.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_aggregated_process.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_aggregated_process.zip `