Create a composite distributionΒΆ

In this example we are going to create a distribution defined as the push-forward distribution of a scalar distribution by a transformation.

If we note \mathcal{L}_0 a scalar distribution, f: \mathbb{R} \rightarrow \mathbb{R} a mapping, then it is possible to create the push-forward distribution \mathcal{L} defined by

\mathcal{L} = f(\mathcal{L}_0)

[20]:
from __future__ import print_function
import openturns as ot
[21]:
# create an 1-d distribution
antecedent = ot.Normal()
[22]:
# Create an 1-d transformation
f = ot.SymbolicFunction(['x'], ['sin(x)+cos(x)'])
[23]:
# Create the composite distribution
distribution = ot.CompositeDistribution(f, antecedent)
distribution.drawPDF()
[23]:
../../_images/examples_probabilistic_modeling_composite_distribution_5_0.svg
[24]:
# Using the simplified construction
distribution = antecedent.exp()
distribution.drawPDF()
[24]:
../../_images/examples_probabilistic_modeling_composite_distribution_6_0.svg
[25]:
# Using chained operators
distribution = antecedent.abs().sqrt()
distribution.drawPDF()
[25]:
../../_images/examples_probabilistic_modeling_composite_distribution_7_0.svg