Create a maximum entropy statistics distributionΒΆ

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

X_1 \leq \dots \leq X_n

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 distributions

coll = [ot.Beta(1.5, 1.7, 0.0, 1.0), ot.Beta(2.0, 2.3, 0.5, 1.2)]

Create the distribution

distribution = ot.MaximumEntropyOrderStatisticsDistribution(coll)
print(distribution)
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!)

distribution.getSample(10)
X0X1
00.88324860.8957517
10.58365420.6722579
20.32650670.9604826
30.81831621.119319
40.52474590.6703216
50.80022620.8102919
60.82869670.9409432
70.67904980.9014674
80.16146311.049137
90.16462970.5626579


Draw PDF

graph = distribution.drawPDF()
view = viewer.View(graph)
plt.show()
X0 iso-PDF