# Create a maximum entropy order statistics distribution¶

In this basic example we are going to build maximum entropy statistics distribution, which yields ordered realizations:

In [1]:

from __future__ import print_function
import openturns as ot

In [2]:

# create a collection of distribution
coll = [ot.Beta(1.5, 3.2, 0.0, 1.0),  ot.Beta(2.0, 4.3, 0.5, 1.2)]

In [3]:

# create the distribution
distribution = ot.MaximumEntropyOrderStatisticsDistribution(coll)
print(distribution)

MaximumEntropyOrderStatisticsDistribution(collection = [Beta(r = 1.5, t = 3.2, a = 0, b = 1),Beta(r = 2, t = 4.3, a = 0.5, b = 1.2)])

In [4]:

# draw a sample (ordered!)
distribution.getSample(10)

Out[4]:

X0 X1 0.5738016812811573 0.640331333512734 0.05614927034653086 1.0876500496604604 0.8609477684252856 0.871370278512005 0.30446376494922667 0.72287671649012 0.36927970200952354 0.9884771935681209 0.30628117978646735 0.9391618306818713 0.6202587092960264 0.7522133010565687 0.9087163222334095 0.9355207646820087 0.1186114351557339 0.6498097139211859 0.3791232064411425 0.7376445845601645
In [5]:

# draw PDF
distribution.drawPDF()

Out[5]: