.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_probabilistic_modeling/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_probabilistic_modeling_stochastic_processes_plot_aggregated_process.py: Aggregate processes =================== .. GENERATED FROM PYTHON SOURCE LINES 6-7 In this example we are going to concatenate several processes that share the same mesh. .. GENERATED FROM PYTHON SOURCE LINES 9-15 .. code-block:: Python import openturns as ot import openturns.viewer as viewer from matplotlib import pylab as plt ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 16-17 Create processes to aggregate .. GENERATED FROM PYTHON SOURCE LINES 17-26 .. 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 27-28 Draw values of a realization of the 2nd process .. GENERATED FROM PYTHON SOURCE LINES 28-32 .. code-block:: Python marginal = ot.HistogramFactory().build(myProcess1.getRealization().getValues()) graph = marginal.drawPDF() view = viewer.View(graph) .. image-sg:: /auto_probabilistic_modeling/stochastic_processes/images/sphx_glr_plot_aggregated_process_001.png :alt: X0 PDF :srcset: /auto_probabilistic_modeling/stochastic_processes/images/sphx_glr_plot_aggregated_process_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 33-34 Create an aggregated process .. GENERATED FROM PYTHON SOURCE LINES 34-36 .. code-block:: Python myAggregatedProcess = ot.AggregatedProcess([myProcess1, myProcess2]) .. GENERATED FROM PYTHON SOURCE LINES 37-38 Draw values of the realization on the 2nd marginal .. GENERATED FROM PYTHON SOURCE LINES 38-44 .. code-block:: Python marginal = ot.HistogramFactory().build( myAggregatedProcess.getRealization().getValues().getMarginal(0) ) graph = marginal.drawPDF() viewer.View(graph) plt.show() .. image-sg:: /auto_probabilistic_modeling/stochastic_processes/images/sphx_glr_plot_aggregated_process_002.png :alt: X0 PDF :srcset: /auto_probabilistic_modeling/stochastic_processes/images/sphx_glr_plot_aggregated_process_002.png :class: sphx-glr-single-img .. _sphx_glr_download_auto_probabilistic_modeling_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 `