.. 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_order_statistics_distribution.py:
Create a maximum entropy statistics distribution
================================================
In this example we are going to build maximum entropy statistics distribution, which yields ordered realizations:
.. math::
X_1 \leq \dots \leq X_n
.. 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 distribution
.. code-block:: default
coll = [ot.Beta(1.5, 1.7, 0.0, 1.0), ot.Beta(2.0, 2.3, 0.5, 1.2)]
create the distribution
.. code-block:: default
distribution = ot.MaximumEntropyOrderStatisticsDistribution(coll)
print(distribution)
.. rst-class:: sphx-glr-script-out
Out:
.. code-block:: none
MaximumEntropyOrderStatisticsDistribution(collection = [Beta(alpha = 1.5, beta = 1.7, a = 0, b = 1),Beta(alpha = 2, beta = 2.3, a = 0.5, b = 1.2)])
draw a sample (ordered!)
.. code-block:: default
distribution.getSample(10)
.. raw:: html
| X0 | X1 |
0 | 0.6440287 | 1.086573 |
1 | 0.7141691 | 0.9588674 |
2 | 0.4362711 | 0.6576377 |
3 | 0.5940418 | 0.6238439 |
4 | 0.5273163 | 0.5399325 |
5 | 0.3097874 | 0.742308 |
6 | 0.6399305 | 0.7142689 |
7 | 0.8138742 | 0.8253311 |
8 | 0.5889975 | 0.7029539 |
9 | 0.4969304 | 0.5786498 |
draw PDF
.. code-block:: default
graph = distribution.drawPDF()
view = viewer.View(graph)
plt.show()
.. image:: /auto_probabilistic_modeling/copulas/images/sphx_glr_plot_order_statistics_distribution_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.428 seconds)
.. _sphx_glr_download_auto_probabilistic_modeling_copulas_plot_order_statistics_distribution.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_order_statistics_distribution.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_order_statistics_distribution.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_