# 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 a scalar distribution, a mapping, then it is possible to create the push-forward distribution defined by

[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]:

[24]:

# Using the simplified construction
distribution = antecedent.exp()
distribution.drawPDF()

[24]:

[25]:

# Using chained operators
distribution = antecedent.abs().sqrt()
distribution.drawPDF()

[25]: