Note
Go to the end to download the full example code.
Create the distribution of the maximum of distributions¶
Context¶
In this example, we define how to build a distribution defined as the maximum of some other ones.
We detail some interesting cases:
Case 1: The maximum of correlated scalar distributions,
Case 2: The maximum of independent scalar distributions,
Case 3: The maximum of independent and identically distributed scalar distributions.
import openturns as ot
import openturns.viewer as otv
Case 2: The maximum of independent scalar distributions¶
Here, we define the random vector where the
are distributed as
and are independent.
We want to define the distribution of:
We create the distribution of :
dist_Y_2 = ot.MaximumDistribution(coll)
We could have written:
dist_X_tilde = ot.JointDistribution(coll)
dist_Y_2 = ot.MaximumDistribution(dist_X_tilde)
We draw its PDF:
graph = dist_Y_2.drawPDF()
graph.setTitle(r" Distribution of $Y_2 = max(\tilde{X}_1,\tilde{X}_2, \tilde{X}_3)$")
graph.setXTitle(r"$Y_2$")
graph.setLegendPosition("")
view = otv.View(graph)
Case 3: The maximum of a independent and identically distributed scalar distributions¶
Here we suppose that and
are independent and identically distributed
as
.
We want to define the distribution of:
We create the distribution of :
dist_Y_3 = ot.MaximumDistribution(dist_X1, 3)
We draw its PDF:
graph = dist_Y_3.drawPDF()
graph.setTitle(r" Distribution of $Y_3 = max(X_1, X_4, X_5)$")
graph.setXTitle(r"$Y_3$")
graph.setLegendPosition("")
view = otv.View(graph)
otv.View.ShowAll()