.. 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
=================================
In this example we are going to create an ordinal sum of copulas.
.. 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 a collection of copulas
.. code-block:: default
collection = [ot.GumbelCopula(2), ot.NormalCopula(2)]
Merge the copulas
.. 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 ]]))
Draw PDF
.. code-block:: default
graph = copula.drawPDF([512]*2)
graph.setXTitle('x')
graph.setYTitle('y')
graph.setLegendPosition('')
view = viewer.View(graph)
plt.show()
.. image:: /auto_probabilistic_modeling/copulas/images/sphx_glr_plot_ordinal_sum_copula_001.png
:alt: [X0,X1] iso-PDF
:class: sphx-glr-single-img
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 0.506 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 `_