
The R-package qad (short for quantification of asymmetric dependence)allows to estimate the (directed) dependence of two random variablesX andY. The estimated population valueq(X,Y) introduced in [1,3] fulfills thefollowing properties:
While the Pearson correlation coefficient assesses only linear andSpearman rank correlation only monotonic relationships, qad is able todetect any kind of association. For further information we refer to thevignette or the related publications [1,2,3].
The easiest way to get the package qad is:
install.packages("qad")In order to install the development version of qad from GitHub:
# install devtools packageif (!requireNamespace("devtools",quietly =TRUE)) {install.packages("devtools")}# install packagedevtools::install_github("griefl/qad",dependencies =TRUE)library(qad)set.seed(314)n<-100x<-rnorm(n)y<- x^2+rnorm(n,0,1)plot(x,y,pch =16)
fit<-qad(x,y)#>#> quantification of asymmetric dependence:#>#> Data: x1 := x#> x2 := y#>#> Sample Size: 100#> Number of unique ranks: x1: 100#> x2: 100#> (x1,x2): 100#> Resolution: 10 x 10#>#> Dependence measures:#> q p.values#> q(x1,x2) 0.610 0.000#> q(x2,x1) 0.393 0.002#> max.dependence 0.610 0.000#>#> a p.values#> asymmetry 0.217 NAcoef(fit)#> q(x1,x2) q(x2,x1) max.dependence asymmetry#> 0.610 0.393 0.610 0.217#> p.q(x1,x2) p.q(x2,x1) p.max.dependence p.asymmetry#> 0.000 0.002 0.000 NA#Comparison with correlationcor(x,y,method ="pearson")#> [1] -0.04404337cor(x,y,method ="spearman")#> [1] 0.06546655cor(x,y,method ="kendall")#> [1] 0.05090909[1] R.R. Junker, F. Griessenberger, W. Trutschnig: Estimatingscale-invariant directed dependence of bivariate distributions,Computational Statistics and Data Analysis, (2021), 153,107058,https://doi.org/10.1016/j.csda.2020.107058
[2] R.R. Junker, F. Griessenberger, W. Trutschnig: A copula-basedmeasure for quantifying asymmetry in dependence and associations,https://arxiv.org/abs/1902.00203
[3] W. Trutschnig: On a strong metric on the space of copulas andits induced dependence measure,Journal of Mathematical Analysis andApplications, 2011, (384), 690-705.https://doi.org/10.1016/j.jmaa.2011.06.013