.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_data_analysis/estimate_dependency_and_copulas/plot_estimate_dependence_wavesurge.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_data_analysis_estimate_dependency_and_copulas_plot_estimate_dependence_wavesurge.py: Estimate tail dependence coefficients on the wave-surge data ============================================================ .. GENERATED FROM PYTHON SOURCE LINES 6-11 In this example we estimate the tail dependence coefficient of a bivariate sample applied to the concurrent measurements of two oceanographic variables (wave and surge heights) at a single location off south-west England. Readers should refer to [coles2001]_ to get more details. First, we load the wave-surge dataset. .. GENERATED FROM PYTHON SOURCE LINES 11-24 .. code-block:: Python import openturns as ot import openturns.viewer as otv from openturns.usecases import coles data = coles.Coles().wavesurge print(data[:5]) graph = ot.Graph("Concurent wave and surge heights", "wave (m)", "surge (m)", True, "") cloud = ot.Cloud(data) cloud.setColor("red") graph.add(cloud) view = otv.View(graph) .. image-sg:: /auto_data_analysis/estimate_dependency_and_copulas/images/sphx_glr_plot_estimate_dependence_wavesurge_001.png :alt: Concurent wave and surge heights :srcset: /auto_data_analysis/estimate_dependency_and_copulas/images/sphx_glr_plot_estimate_dependence_wavesurge_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [ wave surge ] 0 : [ 1.5 -0.009 ] 1 : [ 1.83 -0.053 ] 2 : [ 2.44 -0.024 ] 3 : [ 1.68 0 ] 4 : [ 1.49 0.079 ] .. GENERATED FROM PYTHON SOURCE LINES 25-30 We plot the graph of the function :math:`u \mapsto \chi(u)` and the graph of the function :math:`u \mapsto \bar{\chi}(u)`. We conclude that both variables are asymptotially dependent as :math:`\chi > 0` and that they are positively correlated as :math:`\hat{\chi} > 0`. We can visually deduce the upper tail dependence coefficient :math:`\chi \simeq 0.26` and the upper extremal dependence coefficient :math:`\bar{\chi} \simeq 0.5`. .. GENERATED FROM PYTHON SOURCE LINES 30-38 .. code-block:: Python graph1 = ot.VisualTest.DrawUpperTailDependenceFunction(data) graph2 = ot.VisualTest.DrawUpperExtremalDependenceFunction(data) grid = ot.GridLayout(1, 2) grid.setGraph(0, 0, graph1) grid.setGraph(0, 1, graph2) view = otv.View(grid) .. image-sg:: /auto_data_analysis/estimate_dependency_and_copulas/images/sphx_glr_plot_estimate_dependence_wavesurge_002.png :alt: , Upper tail dependence function, Upper extremal dependence function :srcset: /auto_data_analysis/estimate_dependency_and_copulas/images/sphx_glr_plot_estimate_dependence_wavesurge_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 39-40 .. code-block:: Python otv.View.ShowAll() .. _sphx_glr_download_auto_data_analysis_estimate_dependency_and_copulas_plot_estimate_dependence_wavesurge.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_estimate_dependence_wavesurge.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_estimate_dependence_wavesurge.py `