Composite random vectorΒΆ

In this example we are going to create a random variable \vect{Y} which realizations are the images of the realizations of another random vector \vect{X} by a function.

\vect{Y} = f(\vect{X})

import openturns as ot

Create a random vector based on a distribution

dist2d = ot.Normal(2)
X = ot.RandomVector(dist2d)

Create the function

f = ot.SymbolicFunction(["x1", "x2"], ["x1 + x2", "x1*x2"])
f
[x1,x2]->[x1 + x2,x1*x2]


Create the composite random vector

Y = ot.CompositeRandomVector(f, X)
Y.getSample(5)
y0y1
0-0.6579715-0.7700886
10.7672126-0.5283197
2-1.831343-0.7635766
31.082242-0.5102336
41.6038240.6429862