Fit a non parametric copulaΒΆ

In this example we are going to estimate a normal copula from a sample using non parametric representations.

[1]:
from __future__ import print_function
import openturns as ot
import matplotlib.pyplot as plt
[2]:
# Create data
R = ot.CorrelationMatrix(2)
R[1, 0] = 0.4
copula = ot.NormalCopula(R)
sample = copula.getSample(30)
[3]:
# Estimate a normal copula using BernsteinCopulaFactory
distribution = ot.BernsteinCopulaFactory().build(sample)
[4]:
# Draw fitted distribution
distribution.drawPDF()
[4]:
../../_images/examples_data_analysis_estimate_non_parametric_copula_5_0.svg
[5]:
# Estimate a normal copula using KernelSmoothing
distribution = ot.KernelSmoothing().build(sample).getCopula()
distribution.drawPDF()
[5]:
../../_images/examples_data_analysis_estimate_non_parametric_copula_6_0.svg