Apart from the
Univariate distributions, which only work on single random variables, the Copulas library supports several
Multivariate distributions that support working with multiple random variables at the same time, taking into account the dependencies that may exist between them.
These distributions are supported by the
Multivariate subclasses from defined within the
copulas.multivariate.GaussianMultivariate: Implements a multivariate distribution by combining the marginal univariate distributions with a Gaussian Copula.
copulas.multivariate.VineCopula: Implements a multivariate distribution using Vine Copulas.
In this example we will be using the
GaussianMultivariate class, which implements a multivariate distribution by using a Gaussian Copula to combine marginal probabilities estimated using
Firs of all, let’s load the data that we will be using later on in our examples.
This is a toy dataset with three columns following these distributions:
x: Beta distribution with a=0.1 and b=0.1
y: Beta distribution with a=0.1 and b=0.5
z: Normal distribution + 10 times
from copulas.datasets import sample_trivariate_xyz data = sample_trivariate_xyz()
from copulas.visualization import scatter_3d scatter_3d(data)