Create a random mixture of distributionsΒΆ

In this basic example we are going to build an affine combination of input random variables.

In [10]:
from __future__ import print_function
import openturns as ot
In [11]:
# create a collection of distribution
collDist = [ot.Normal(), ot.Uniform(-5,0)]
In [12]:
# create the mixture
distribution = ot.RandomMixture(collDist)
print(distribution)
RandomMixture(Normal(mu = 0, sigma = 1) + Uniform(a = -5, b = 0))
In [13]:
# draw PDF
distribution.drawPDF()
Out[13]:
../../_images/examples_probabilistic_modeling_random_mixture_distribution_5_0.svg