Create a conditional distributionΒΆ

In this basic example we are going to build a conditional distribution in the form


with X conditioned by the random variable Theta obtained with the random variable Y through a function f


In [13]:
from __future__ import print_function
import openturns as ot
In [14]:
# create the Y distribution
YDist = ot.Normal(0.0, 1.0)
In [15]:
# create Theta=f(y)
f = ot.SymbolicFunction(['y'], ['y', '0.1+y^2'])
In [16]:
# create the X|Theta distribution
XgivenThetaDist = ot.Normal()
In [17]:
# create the distribution
XDist = ot.ConditionalDistribution(XgivenThetaDist, YDist, f)
ConditionalDistribution(X with X|Theta~Normal(Theta), Theta=f(Y), f=[y]->[y,0.1+y^2], Y~Normal(mu = 0, sigma = 1))
In [18]:
# draw PDF