.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_probabilistic_modeling/distributions/plot_maximum_distribution.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_distributions_plot_maximum_distribution.py: Create the distribution of the maximum of independent distributions =================================================================== .. GENERATED FROM PYTHON SOURCE LINES 6-7 In this example we are going to build the distribution of the maximum of independent distributions. .. 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 a collection of distribution .. GENERATED FROM PYTHON SOURCE LINES 17-21 .. code-block:: Python distribution1 = ot.Normal() distribution2 = ot.Uniform(-1.0, 2.0) distColl = [distribution1, distribution2] .. GENERATED FROM PYTHON SOURCE LINES 22-23 create the distribution .. GENERATED FROM PYTHON SOURCE LINES 23-26 .. code-block:: Python distribution = ot.MaximumDistribution(distColl) print(distribution) .. rst-class:: sphx-glr-script-out .. code-block:: none MaximumDistribution(ComposedDistribution(Normal(mu = 0, sigma = 1), Uniform(a = -1, b = 2), IndependentCopula(dimension = 2))) .. GENERATED FROM PYTHON SOURCE LINES 27-28 draw PDF .. GENERATED FROM PYTHON SOURCE LINES 28-31 .. code-block:: Python graph = distribution.drawPDF() view = viewer.View(graph) plt.show() .. image-sg:: /auto_probabilistic_modeling/distributions/images/sphx_glr_plot_maximum_distribution_001.png :alt: plot maximum distribution :srcset: /auto_probabilistic_modeling/distributions/images/sphx_glr_plot_maximum_distribution_001.png :class: sphx-glr-single-img .. _sphx_glr_download_auto_probabilistic_modeling_distributions_plot_maximum_distribution.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_maximum_distribution.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_maximum_distribution.py `