library(copula)
library(KendallSignature)
library(rcdd)
library(gMOIP)
library(rgl)
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
knitr::knit_hooks$set(webgl = hook_webgl)

A 4D example with equicorrelation structure

In this example we take a 4 dimensional copula and assume that all the pairwise probabilities of concordance are equal to some value $\kappa_2$. We determine first the minimum value for the 4th order probability of concordance $\kappa_4$ and then the maximum value using linear programming. These can be checked against the true values which can be determined analytically without recourse to optimization.

d <- 4
kappa2 <- 0.7
kappa <- c(1, rep(kappa2, choose(d, 2)))
names(kappa) <- evenpowerset(d)[1:length(kappa)]

findpolytope(kappa, d)

max(2*kappa2 -1, 0)
(3*kappa2 -1)/2

A 4D example with heterogeneous correlations

Here is a $4 \times 4$ matrix of Kendall's tau values and the corresponding partial concordance signature.

tau <- c(-0.19, -0.29, 0.49, -0.34, 0.3, -0.79)
p2P(tau)
kappa <- c(1, (1+tau)/2)
names(kappa) <- evenpowerset(d)[1:length(kappa)]

We will find the vertices of the polytope of solutions for the extremal mixture copula that matches the concordance signature.

findpolytope(kappa, d = 4)

There are two vertices, one which minimizes the fourth order concordance probability and one that maximizes it. Any convex combination of these vertices specifies a mixture of extremal copulas that matches the Kendall's tau values. Let's check this is true for the two vertices.

kappa
w <- findpolytope(kappa, d = 4)
Amatrix(4) %*% t(w)

A 5D example

Now let's look at an example when the dimension of the copula is 5, all the pairwise concordance probabilities are 2/3 and the 4-dimensional concordance probabilities for ${1, 2, 3, 4}$ and ${1, 2, 3, 5}$ are both 0.4. In this case there are 9 vertices.

d <- 5
kappa <- c(1, rep(2/3, choose(d, 2)), 0.4, 0.4)
names(kappa) <- evenpowerset(5)[1:length(kappa)]
w <- findpolytope(kappa, d = d)
w

Let's check that they do give the asserted values for the concordance probabilities.

allkappa <- Amatrix(d) %*% t(w)
allkappa

The final 3 rows of the last matrix matrix specify the 9 vertices of the polytope of attainable values for the unspecified 4th order concordance probabilities. Since there are only 3 of these values we can show the polytope in a 3-dimensional plot.

nvertex <- nrow(allkappa)
vertices <- t(allkappa[(nvertex-2) : nvertex, ])
plot3d(vertices)
plotHull3D(vertices)


ajmcneil/extremalcopula documentation built on Jan. 25, 2022, 11:54 p.m.