{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Composite random vector" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this example we are going to create a random variable $\\underline{Y}$ which realizations are the images of the realizations of another random vector $\\underline{X}$ by a function.\n", "\n", "$$\\underline{Y} = f(\\underline{X}) $$" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "from __future__ import print_function\n", "import openturns as ot\n", "import math as m" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Create a random vector based on a distribution\n", "dist2d = ot.Normal(2)\n", "X = ot.RandomVector(dist2d)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
[x1,x2]->[x1 + x2,x1*x2]
\n",
"
y0 | y1 | |
---|---|---|
0 | 0.6340067547705874 | -1.738141317991343 |
1 | 0.860261107301864 | -0.4291467493292659 |
2 | -2.1455645614220247 | 1.0633942511691827 |
3 | -0.7883451164543616 | -0.0922805136143649 |
4 | 1.2403961348448758 | 0.3031904202688173 |