.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_probabilistic_modeling/copulas/plot_ordinal_sum_copula.py" .. LINE NUMBERS ARE GIVEN BELOW. .. 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_copulas_plot_ordinal_sum_copula.py: Create the ordinal sum of copulas ================================= .. GENERATED FROM PYTHON SOURCE LINES 6-7 In this example we are going to create an ordinal sum of copulas. .. GENERATED FROM PYTHON SOURCE LINES 9-14 .. code-block:: default 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 15-16 Create a collection of copulas .. GENERATED FROM PYTHON SOURCE LINES 16-18 .. code-block:: default collection = [ot.GumbelCopula(2), ot.NormalCopula(2)] .. GENERATED FROM PYTHON SOURCE LINES 19-20 Merge the copulas .. GENERATED FROM PYTHON SOURCE LINES 20-24 .. code-block:: default bounds = [0.3] copula = ot.OrdinalSumCopula(collection, bounds) print(copula) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none OrdinalSumCopula([0, 0.3], GumbelCopula(theta = 2), [0.3, 1], NormalCopula(R = [[ 1 0 ] [ 0 1 ]])) .. GENERATED FROM PYTHON SOURCE LINES 25-26 Draw PDF .. GENERATED FROM PYTHON SOURCE LINES 26-32 .. code-block:: default graph = copula.drawPDF([512]*2) graph.setXTitle('x') graph.setYTitle('y') graph.setLegendPosition('') view = viewer.View(graph) plt.show() .. image-sg:: /auto_probabilistic_modeling/copulas/images/sphx_glr_plot_ordinal_sum_copula_001.png :alt: [X0,X1] iso-PDF :srcset: /auto_probabilistic_modeling/copulas/images/sphx_glr_plot_ordinal_sum_copula_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.489 seconds) .. _sphx_glr_download_auto_probabilistic_modeling_copulas_plot_ordinal_sum_copula.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_ordinal_sum_copula.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ordinal_sum_copula.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_