Create a conditional random vectorΒΆ

In this example we are going to build a conditional random vector

\vect X|\vect\Theta

import openturns as ot

Create the random vector \vect\Theta (parameters of \vect X)

gammaDist = ot.Uniform(1.0, 2.0)
alphaDist = ot.Uniform(0.0, 0.1)
thetaDist = ot.JointDistribution([gammaDist, alphaDist])
thetaRV = ot.RandomVector(thetaDist)

Create the \vect X|\vect\Theta distribution

XgivenThetaDist = ot.Exponential()

Create the \vect X distribution

XDist = ot.ConditionalRandomVector(XgivenThetaDist, thetaRV)

Draw a sample

XDist.getSample(5)
X0
01.063651
10.3375136
21.11396
30.23037
40.744067