.. 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 7-8 In this example we are going to build the distribution of the maximum of independent distributions. .. GENERATED FROM PYTHON SOURCE LINES 10-16 .. 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 17-18 Create a collection of distributions .. GENERATED FROM PYTHON SOURCE LINES 18-22 .. code-block:: Python distribution1 = ot.Normal() distribution2 = ot.Uniform(-1.0, 2.0) distColl = [distribution1, distribution2] .. GENERATED FROM PYTHON SOURCE LINES 23-24 Create the distribution .. GENERATED FROM PYTHON SOURCE LINES 24-27 .. code-block:: Python distribution = ot.MaximumDistribution(distColl) print(distribution) .. rst-class:: sphx-glr-script-out .. code-block:: none MaximumDistribution(JointDistribution(Normal(mu = 0, sigma = 1), Uniform(a = -1, b = 2), IndependentCopula(dimension = 2))) .. GENERATED FROM PYTHON SOURCE LINES 28-29 Draw PDF .. GENERATED FROM PYTHON SOURCE LINES 29-32 .. 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 ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_maximum_distribution.zip `