Create a composed distributionΒΆ

In this basic example we are going to create a multidimensional distribution described by its marginal distributions and optionally its dependence structure (a particular copula).

In [1]:
from __future__ import print_function
import openturns as ot
In [2]:
# create the marginals
marginals = [ot.Normal(), ot.Gumbel()]
In [3]:
# create the multivariate distribution, assume no dependency structure
distribution = ot.ComposedDistribution(marginals)
In [4]:
# draw PDF
distribution.drawPDF()
Out[4]:
../../_images/examples_probabilistic_modeling_composed_distribution_5_0.svg
In [5]:
# create the copula which specifies the dependency structure
R = ot.CorrelationMatrix(2)
R[0, 1] = 0.3
copula = ot.NormalCopula(R)
copula
Out[5]:

NormalCopula(R = [[ 1 0.3 ]
[ 0.3 1 ]])

In [6]:
# create the multivariate distribution with the desired copula
distribution = ot.ComposedDistribution(marginals, copula)
In [7]:
# draw PDF
distribution.drawPDF()
Out[7]:
../../_images/examples_probabilistic_modeling_composed_distribution_8_0.svg