Generate a contour density plot after the advocation of Joe (2014, pp. 9--15). Such graphics are plots of scaled copula densities (\(c^\star(u,v)\), bivariate herein) that are copula densities scaled to the standard normal distribution \(\sim\) N(0,1) margins. Joe (2014) repeatedly emphasizes such plots in contrast to the uniform distribution \(\sim\) U(0,1) margins. Nelsen (2006) does not discuss such scaling but seemingly Nelsen's objectives for his book were somewhat different.
The density of copula \(\mathbf{C}(u,v)\) is numerically estimated by
$$c(u,v) = \bigl[\mathbf{C}(u_2,v_2) - \mathbf{C}(u_2,v_1) - \mathbf{C}(u_1,v_2) + \mathbf{C}(u_1,v_1)\bigr]\, /\, \bigl[\Delta(uv)\times\Delta(uv)\bigr]\mbox{,}$$
where \(c(u,v) \ge 0\) (see Nelsen, 2006, p. 10; densityCOP
). Given a numerically estimated quantity \(c^\star(u,v) = c(u,v)\times\phi(\Phi^{(-1)}(u))\times\phi(\Phi^{(-1)}(v))\) for copula density \(c(u,v)\), a grid of the \(c^\star(u,v)\) values can be contoured by the contour()
function in R. The density function of the N(0,1) is \(\phi(z)\) for standard normal variate \(z\) and the quantile function of the N(0,1) is \(\Phi^{(-1)}(t)\) for nonexceedance probability \(t\).
A grid (matrix) of \(c(u,v)\) or \(c^\star(u,v)\) is defined for sequence of \(u\) and \(v\) probabilities for which each sequence has equal steps that are equal to \(\Delta(uv)\). This function has as focus on plotting of the contour lines of \(c^\star(u,v)\) but the R matrix
of either \(c(u,v)\) or \(c^\star(u,v)\) can be requested on return. For either matrix, the colnames()
and rownames()
(the R functions) are set equal to the sequence of \(u\) and \(v\), respectively. Neither the column or row names are set to the standard normal variates for the matrix of \(c^\star(u,v)\), the names remain in terms of nonexceedance probability.
For plotting and other uses of normal scores of data, Joe (2014, p. 245) advocates that one should use the plotting position formula \(u_i = (i-1/2)/n\) (Hazen plotting position) for normal scores \(z_i = \Phi^{-1}(u_i)\) in preference to \(i/(n+1)\) (Weibull plotting position) because \(n^{-1}\sum_{i=1}^{n} z^2_i\) is closer to unity. Other examples of Joe's advocation for the Hazen plotting positions are available (Joe, 2014, pp. 9, 17, 245, 247--248).
densityCOPplot(cop=NULL, para=NULL, deluv=0.002,
getmatrix=c("none", "cdenzz", "cden"), n=0,
ploton=TRUE, snv=TRUE, origins=TRUE,
contour.col=1, contour.lwd=1.5, ...)
This is a high-level function used for its side effects; an R
matrix
can be triggered, however, as a returned value.
Joe, H., 2014, Dependence modeling with copulas: Boca Raton, CRC Press, 462 p.
Nelsen, R.B., 2006, An introduction to copulas: New York, Springer, 269 p.
simCOP
, densityCOP