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

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

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)

Out:

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.46229150.7543465
10.25527850.7343233
20.55617940.6310661
30.18431760.8787142
40.24508440.8330352
50.63807050.7940242
60.31188010.8304515
70.45251620.6586167
80.67248170.8490304
90.29772580.9140666


draw PDF

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

Out:

/home/devel/project/build/python/src/site-packages/openturns/viewer.py:437: UserWarning: No contour levels were found within the data range.
  contourset = self._ax[0].contour(X, Y, Z, **contour_kw)

Total running time of the script: ( 0 minutes 1.663 seconds)

Gallery generated by Sphinx-Gallery