Note
Click here to download the full example code
Create a maximum entropy statistics distributionΒΆ
In this example we are going to build maximum entropy statistics distribution, which yields ordered realizations:
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)
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
graph = distribution.drawPDF()
view = viewer.View(graph)
plt.show()
Total running time of the script: ( 0 minutes 0.428 seconds)