3.3.2. The copula classes
Instead of using samplers with correlation matrix in the case of intricate variables, one can use
classes relying on Copula, in order to describe the dependencies. These classes inherit from the
TCopula class successively through the TSamplerStochastic and the TSampler classes. The idea of
a copula is to define the interaction of variables using a parametric-function that can allow a
broader range of entanglement than only using a correlation matrix (various shapes can be done).
There are two kinds of copulas provided in the Uranie platform:
TArchimedian with 4 pre-defined parametrisation: Ali-Mikhail-Haq (
TAMHCopula), Clayton (TClaytonCopula), Frank (TFrankCopula) and Plackett (TPlackettCopula). These copulas, which depend only on the input variables and a parameter \(\theta\), are shown from Figure 3.6 to Figure 3.9 for different \(\theta\) values along with the formula of the corresponding parametric function.TElliptical: it is a class to interface the
TGaussiancopula method.
Figure 3.6 Example of sampling done with half million points and two uniform attributes (from 0 to 1),
using AMH copula and varying the parameter value.
Figure 3.7 Example of sampling done with half million points and two uniform attributes (from 0 to 1),
using Clayton copula and varying the parameter value.
Figure 3.8 Example of sampling done with half million points and two uniform attributes (from 0 to 1),
using Frank copula and varying the parameter value.
Figure 3.9 Example of sampling done with half million points and two uniform attributes (from 0 to 1),
using Plackett copula and varying the parameter value.
The following example shows how to create a copula and to use it in order to get a correlated sample.
xunif = DataServer.TUniformDistribution("x1", 3., 4.)
xnorm = DataServer.TNormalDistribution("x2", 0.5, 1.5)
tds = DataServer.TDataServer("tdsSampling", "Demonstration Sampling")
tds.addAttribute(xunif)
tds.addAttribute(xnorm)
# Generate the sampling from the TDataServer object
tamh = Sampler.TAMHCopula(tds, 0.75, 1000)
tamh.generateSample()
tds.Draw("x2:x1", "", "colZ")