.. 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 Click :ref:`here ` 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-18 .. code-block:: default import openturns as ot import openturns.viewer as viewer from matplotlib import pylab as plt .. GENERATED FROM PYTHON SOURCE LINES 19-20 create the random vector Theta (parameters of X) .. GENERATED FROM PYTHON SOURCE LINES 20-25 .. code-block:: default 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 26-27 create the XgivenTheta distribution .. GENERATED FROM PYTHON SOURCE LINES 27-29 .. code-block:: default XgivenThetaDist = ot.Exponential() .. GENERATED FROM PYTHON SOURCE LINES 30-31 create the X distribution .. GENERATED FROM PYTHON SOURCE LINES 31-33 .. code-block:: default XDist = ot.ConditionalRandomVector(XgivenThetaDist, thetaRV) .. GENERATED FROM PYTHON SOURCE LINES 34-35 draw a sample .. GENERATED FROM PYTHON SOURCE LINES 35-36 .. code-block:: default XDist.getSample(5) .. raw:: html
X0
00.1854715
10.1560417
20.6647259
30.4157063
40.2783648


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.002 seconds) .. _sphx_glr_download_auto_probabilistic_modeling_distributions_plot_conditional_random_vector.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_conditional_random_vector.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_conditional_random_vector.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_