Create a conditional random vectorΒΆ

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

\underline{X}|\underline{\Theta}

import openturns as ot

create the random vector Theta (parameters of 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 XgivenTheta distribution

XgivenThetaDist = ot.Exponential()

create the X distribution

XDist = ot.ConditionalRandomVector(XgivenThetaDist, thetaRV)

draw a sample

XDist.getSample(5)
X0
00.5935767
10.7642794
21.305296
30.3351013
40.3904474