Fit a copula using a non parametric approachΒΆ

In this example we are going to estimate the parameters of a Bernstein copula from a sample.

In [6]:
from __future__ import print_function
import openturns as ot
import matplotlib.pyplot as plt
In [7]:
# Create data
R = ot.CorrelationMatrix(2)
R[1, 0] = 0.4
copula = ot.NormalCopula(R)
sample = copula.getSample(500)
In [8]:
# Estimate a normal distribution
distribution = ot.BernsteinCopulaFactory().build(sample)
In [9]:
# Draw fitted distribution
distribution.drawPDF()
Out[9]:
../../_images/examples_statistical_estimation_estimate_non_parametric_copula_5_0.svg