Exchangeability Test¶

copulae.gof.
exch_test
(x, y, N=1000, m=0, ties='average')[source]¶ Test of Exchangeability for a Bivariate Copula.
Test for assessing the exchangeability of the underlying bivariate copula based on the empirical copula. The test statistics are defined in the first two references. Approximate pvalues for the test statistics are obtained by means of a multiplier technique if there are no ties in the component series of the bivariate data, or by means of an appropriate bootstrap otherwise.
A random vector X is called exchangeable iff \((X1, ..., Xd) = (X_{\pi(1)}, ..., X_{\pi(d)})\) for any permutation \((\pi(1), \pi(2), \dots, \pi(d))\) of \((1, \dots, d)\).
A copula C is called exchangeable iff C is the distribution function of an exchangeable random vector (with uniform marginal distributions on [0, 1]). For such a copula \(C(u1, u2, ..., ud ) = C(u\pi(1), u\pi(2), ..., u\pi(d))\) holds for any permutation \((\pi(1), \pi(2), \dots, \pi(d))\) of \((1, \dots, d)\).
 Examples of exchangeable copulas:
Gumbel, Clayton, and also the Gaussian copula \(C_P^{Ga}\) and the tCopula \(C_{ν,P}^t\), if P is an equicorrelation matrix, i.e. \(R = \rho J_d + (1 − \rho)I_d\). \(J_d \in R^{d×d}\) is a matrix consisting only of ones, and \(I_d \in R^{d×d}\) is the ddimensional identity matrix.
For bivariate exchangeable copulas we have:
\[P(U_2 \leq u_2U_1 = u_1) = P(U_1 \leq u_2U_2 = u_1).\] Parameters
x (array_like) – first vector for the exchangeability test
y (array_like) – second vector for the exchangeability test
N (int) – Number of multiplier or bootstrap iterations to be used to simulate realizations of the test statistic under the null hypothesis.
m (int) – If m = 0, integration in the Cramér–von Mises statistic is carried out with respect to the empirical copula. If m > 0, integration is carried out with respect to the Lebesgue measure and m specifies the size of the integration grid.
ties (str, optional) – String specifying how ranks should be computed if there are ties in any of the coordinate samples. Options include ‘average’, ‘min’, ‘max’, ‘dense’, ‘ordinal’.
 Returns
Test statistics for the exchangeability test. The null hypothesis assumes that the vectors are exchangeable. Thus a small pvalue will indicate evidence against exchangeability
 Return type
TestStatistic
Examples
>>> from copulae.datasets import load_danube >>> from copulae.gof import exch_test >>> danube = load_danube().values >>> test_stats = exch_test(danube[:, 0], danube[:, 1]) >>> print(test_stats.p_value)
A small pvalue here indicates strong evidence against exchangeability
References
Genest, C., G. Nešlehová, J. and Quessy, J.F. (2012). Tests of symmetry for bivariate copulas. Annals of the Institute of Statistical Mathematics 64, 811–834.
Kojadinovic, I. and Yan, J. (2012). A nonparametric test of exchangeability for extremevalue and lefttail decreasing bivariate copulas. The Scandinavian Journal of Statistics 39:3, 480–496.
Kojadinovic, I. (2017). Some copula inference procedures adapted to the presence of ties. Computational Statistics and Data Analysis 112, 24–41, http://arxiv.org/abs/1609.05519.