Goodness-of-fit tests for copulasΒΆ
The Cramer-von Mises and Kolmogorov-Smirnov tests below check whether a multivariate sample is drawn from a given copula. They compare the empirical copula built from the sample with the candidate copula, following the approach of [genest2009].
Let be a sample of
dimension
with continuous margins and copula
. Since copulas are
invariant under strictly increasing transformations of the margins, the
tests work on the pseudo-observations
where is the rank of
among
. The sample under test can
therefore be either a sample from the copula itself (values in
) or a raw observations sample: the pseudo-observations
are computed internally from the ranks. Let
be the
empirical cumulative distribution function of the unknown copula
,
defined by:
Let be the candidate copula: either a fully
specified copula, or a copula whose parameters
have been estimated from the sample with a
DistributionFactory (the estimated distribution must be a copula).
Two statistics measure the distance
between and
:
the Cramer-von Mises statistic
the Kolmogorov-Smirnov statistic
Large values of these statistics lead to rejection of the null hypothesis
that the underlying copula
belongs to the candidate family. Under
, the asymptotic
distributions of
and
depend
on the unknown copula parameter, so they cannot be tabulated: the p-value
is estimated with a parametric bootstrap. Bootstrap samples are drawn from
the tested (or estimated) copula and the statistic is recomputed on each of
them, re-estimating the parameters in the factory case, until the requested
precision is reached. This follows the same adaptive Monte Carlo scheme as
the The Kolmogorov-Smirnov goodness of fit test for continuous data with estimated parameters (Lilliefors
test).
We fix a risk (type I error) and reject the candidate copula
if the estimated p-value is lower than or equal to
.
OpenTURNS