rhoCOP {copBasic} | R Documentation |
The Spearman Rho of a Copula
Description
Compute the measure of association known as the Spearman Rho of a copula according to Nelsen (2006, pp. 167–170, 189, 208) by
or
where the later equation is implemented by rhoCOP
as the default method (method="default"
). This equation, here having and
, is generalized under
hoefCOP
. The absence of the in the above equation makes it equal to the covariance defined by the Hoeffding Identity (Joe, 2014, p. 54):
Depending on copula family (Joe, 2014, pp. 56 and 267), the alternative formulation for could be used
where the first integral form corresponds to Joe (2014, eq. 248, p. 56) and is the method="joe21"
, and the second integral form is the method="joe12"
.
The integral
represents the “volume under the graph of the copula and over the unit square” (Nelsen, 2006, p. 170) and therefore is simple a rescaled volume under the copula. The second equation for
expresses the “average distance” between the joint distribution and statistical independence
. Nelsen (2006, pp. 175–176) shows that the following relation between
and
(
tauCOP
) exists
Usage
rhoCOP(cop=NULL, para=NULL, method=c("default", "joe21", "joe12"),
as.sample=FALSE, brute=FALSE, delta=0.002, ...)
Arguments
cop |
A copula function; |
para |
Vector of parameters or other data structure, if needed, to pass to the copula; |
method |
The form of integration used to compute (see above); |
as.sample |
A logical controlling whether an optional R |
brute |
Should brute force be used instead of two nested |
delta |
The |
... |
Additional arguments to pass. |
Value
The value for is returned.
Note
Technically, Nelsen (2006) also shows that these definitions are a form of call to a concordance function of two copulas that involve
and
. As such in order to keep
rhoCOP
a small function when brute=TRUE
, is computed by a special call to
tauCOP
, which by itself and although titled for computation of Kendall Tau, does support the concordance function [see Nelsen (2006, pp. 158–159)] when given two different copulas and respective parameters as arguments. The well-known Pearson correlation coefficient equals Spearman rho value if random variables
and
are both uniformly distributed on
.
Author(s)
W.H. Asquith
References
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.
See Also
blomCOP
, footCOP
, giniCOP
,
hoefCOP
, tauCOP
, wolfCOP
,
joeskewCOP
, uvlmoms
Examples
rhoCOP(cop=PSP) # 0.4784176
## Not run:
rhoCOP(cop=PSP, brute=TRUE) # 0.4684063
# CPU heavy example showing that the dual-integration (fast) results in
# a Spearman Rho that mimics a sample version
do_rho <- function(n) {
uv <- simCOP(n=n, cop=PSP, ploton=FALSE, points=FALSE)
return(cor(uv$U, uv$V, method="spearman"))
}
rhos <- replicate(100, do_rho(1000))
rho_sample <- mean(rhos); print(rho_sample) # 0.472661
## End(Not run)
## Not run:
para <- list(cop1=PLACKETTcop, cop2=PLACKETTcop,
para1=0.00395, para2=4.67, alpha=0.9392, beta=0.5699)
rhoCOP(cop=composite2COP, para=para) # -0.5924796
para <- list(cop1=PLACKETTcop, cop2=PLACKETTcop,
para1=0.14147, para2=20.96, alpha=0.0411, beta=0.6873)
rhoCOP(cop=composite2COP, para=para) # 0.2818874
para <- list(cop1=PLACKETTcop, cop2=PLACKETTcop,
para1=0.10137, para2=4492.87, alpha=0.0063, beta=0.0167)
rhoCOP(cop=composite2COP, para=para) # 0.9812919
rhoCOP(cop=composite2COP, para=para, brute=TRUE) # 0.9752155
## End(Not run)
## Not run:
# This is the same composited copula used in a highly asymmetric multi-modal
# plotting example under densityCOPplot(). Let us use that copula as a means to
# check on the Spearman Rho from the alternative formulations from Joe (2014).
para <- list(alpha=0.15, beta=0.90, kappa=0.06, gamma=0.96,
cop1=GHcop, cop2=PLACKETTcop, para1=5.5, para2=0.07)
"rhoCOPbyJoe21" <- function(cop=NULL, para=NULL, ...) { # Joe (2014, eq. 2.48)
myint <- NULL
try(myint <- integrate(function(u) {
sapply(u,function(u) { integrate(function(v) {
u * derCOP( u, v, cop=cop, para=para, ...)}, 0, 1)$value })}, 0, 1))
ifelse(is.null(myint), return(NA), return(3 - 12*myint$value))
}
"rhoCOPbyJoe12" <- function(cop=NULL, para=NULL, ...) { # Not in Joe (2014)
myint <- NULL
try(myint <- integrate(function(u) {
sapply(u,function(u) { integrate(function(v) {
v * derCOP2( u, v, cop=cop, para=para, ...)}, 0, 1)$value })}, 0, 1))
ifelse(is.null(myint), return(NA), return(3 - 12*myint$value))
}
rhoCOP( cop=composite2COP, para=para) # 0.1031758
rhoCOPbyJoe21(cop=composite2COP, para=para) # 0.1031803
rhoCOPbyJoe12(cop=composite2COP, para=para) # 0.1031532
## End(Not run)