Create a maximum entropy statistics distributionΒΆ
In this example we are going to build maximum entropy statistics distribution, which yields ordered realizations:
[1]:
from __future__ import print_function
import openturns as ot
[2]:
# 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)]
[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)])
[4]:
# draw a sample (ordered!)
distribution.getSample(10)
[4]:
X0 | X1 | |
---|---|---|
0 | 0.5738016812811573 | 0.640331333512734 |
1 | 0.05614927034653086 | 1.0876500496604604 |
2 | 0.8609477684252856 | 0.871370278512005 |
3 | 0.30446376494922667 | 0.72287671649012 |
4 | 0.36927970200952354 | 0.9884771935681209 |
5 | 0.30628117978646735 | 0.9391618306818713 |
6 | 0.6202587092960264 | 0.7522133010565687 |
7 | 0.9087163222334095 | 0.9355207646820087 |
8 | 0.1186114351557339 | 0.6498097139211859 |
9 | 0.3791232064411425 | 0.7376445845601645 |
[5]:
# draw PDF
distribution.drawPDF()
[5]: