.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_probabilistic_modeling/distributions/plot_conditional_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_distributions_plot_conditional_random_vector.py: Create a conditional random vector ================================== .. GENERATED FROM PYTHON SOURCE LINES 7-12 In this example we are going to build a conditional random vector .. math:: \underline{X}|\underline{\Theta} .. GENERATED FROM PYTHON SOURCE LINES 14-16 .. code-block:: Python import openturns as ot .. GENERATED FROM PYTHON SOURCE LINES 17-18 create the random vector Theta (parameters of X) .. GENERATED FROM PYTHON SOURCE LINES 18-23 .. code-block:: Python gammaDist = ot.Uniform(1.0, 2.0) alphaDist = ot.Uniform(0.0, 0.1) thetaDist = ot.ComposedDistribution([gammaDist, alphaDist]) thetaRV = ot.RandomVector(thetaDist) .. GENERATED FROM PYTHON SOURCE LINES 24-25 create the XgivenTheta distribution .. GENERATED FROM PYTHON SOURCE LINES 25-27 .. code-block:: Python XgivenThetaDist = ot.Exponential() .. GENERATED FROM PYTHON SOURCE LINES 28-29 create the X distribution .. GENERATED FROM PYTHON SOURCE LINES 29-31 .. code-block:: Python XDist = ot.ConditionalRandomVector(XgivenThetaDist, thetaRV) .. GENERATED FROM PYTHON SOURCE LINES 32-33 draw a sample .. GENERATED FROM PYTHON SOURCE LINES 33-34 .. code-block:: Python XDist.getSample(5) .. raw:: html
X0
00.5935767
10.7642794
21.305296
30.3351013
40.3904474


.. _sphx_glr_download_auto_probabilistic_modeling_distributions_plot_conditional_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_conditional_random_vector.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_conditional_random_vector.py `