.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_probabilistic_modeling/random_vectors/plot_composite_random_vector.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_probabilistic_modeling_random_vectors_plot_composite_random_vector.py: Composite random vector ======================= .. GENERATED FROM PYTHON SOURCE LINES 6-12 In this example we are going to create a random variable :math:`\underline{Y}` which realizations are the images of the realizations of another random vector :math:`\underline{X}` by a function. .. math:: \underline{Y} = f(\underline{X}) .. GENERATED FROM PYTHON SOURCE LINES 14-18 .. code-block:: Python import openturns as ot ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 19-20 Create a random vector based on a distribution .. GENERATED FROM PYTHON SOURCE LINES 20-23 .. code-block:: Python dist2d = ot.Normal(2) X = ot.RandomVector(dist2d) .. GENERATED FROM PYTHON SOURCE LINES 24-25 Create the function .. GENERATED FROM PYTHON SOURCE LINES 25-28 .. code-block:: Python f = ot.SymbolicFunction(["x1", "x2"], ["x1 + x2", "x1*x2"]) f .. raw:: html
[x1,x2]->[x1 + x2,x1*x2]


.. GENERATED FROM PYTHON SOURCE LINES 29-30 Create the composite random vector .. GENERATED FROM PYTHON SOURCE LINES 30-32 .. code-block:: Python Y = ot.CompositeRandomVector(f, X) .. GENERATED FROM PYTHON SOURCE LINES 33-34 .. code-block:: Python Y.getSample(5) .. raw:: html
y0y1
0-2.3466341.367485
1-1.2798330.3801989
21.09672-0.04583323
32.2984121.153096
40.71123750.06075101


.. _sphx_glr_download_auto_probabilistic_modeling_random_vectors_plot_composite_random_vector.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_composite_random_vector.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_composite_random_vector.py `