Create a composite distributionΒΆ

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

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