.. 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_auto_probabilistic_modeling_stochastic_processes_plot_aggregated_process.py:
Aggregate processes
===================
In this example we are going to concatenate several processes that share the same mesh.
.. code-block:: default
from __future__ import print_function
import openturns as ot
import openturns.viewer as viewer
from matplotlib import pylab as plt
ot.Log.Show(ot.Log.NONE)
Create processes to aggregate
.. code-block:: default
myMesher = ot.IntervalMesher(ot.Indices([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)
Draw values of a realization of the 2nd process
.. code-block:: default
marginal = ot.HistogramFactory().build(myProcess1.getRealization().getValues())
graph = marginal.drawPDF()
view = viewer.View(graph)
.. image:: /auto_probabilistic_modeling/stochastic_processes/images/sphx_glr_plot_aggregated_process_001.png
:alt: X0 PDF
:class: sphx-glr-single-img
Create an aggregated process
.. code-block:: default
myAggregatedProcess = ot.AggregatedProcess([myProcess1, myProcess2])
Draw values of the realization on the 2nd marginal
.. code-block:: default
marginal = ot.HistogramFactory().build(myAggregatedProcess.getRealization().getValues().getMarginal(0))
graph = marginal.drawPDF()
viewer.View(graph)
plt.show()
.. image:: /auto_probabilistic_modeling/stochastic_processes/images/sphx_glr_plot_aggregated_process_002.png
:alt: X0 PDF
:class: sphx-glr-single-img
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 0.144 seconds)
.. _sphx_glr_download_auto_probabilistic_modeling_stochastic_processes_plot_aggregated_process.py:
.. only :: html
.. container:: sphx-glr-footer
:class: sphx-glr-footer-example
.. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_aggregated_process.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_aggregated_process.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_