Fit a normal copulaΒΆ

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

In [9]:
from __future__ import print_function
import openturns as ot
import matplotlib.pyplot as plt
In [10]:
# Create data
R = ot.CorrelationMatrix(2)
R[1, 0] = 0.4
copula = ot.NormalCopula(R)
sample = copula.getSample(500)
In [11]:
# Estimate a normal distribution
distribution = ot.NormalCopulaFactory().build(sample)
print(distribution)
NormalCopula(R = [[ 1        0.361442 ]
 [ 0.361442 1        ]])
In [12]:
# Draw fitted distribution
distribution.drawPDF()
Out[12]:
../../_images/examples_statistical_estimation_estimate_copula_5_0.svg