qad {qad} | R Documentation |
Measure of (asymmetric and directed) dependence
Description
Quantification of (asymmetric and directed) dependence structures between two random variables X and Y.
Usage
qad(x, ...)
## S3 method for class 'data.frame'
qad(
x,
resolution = NULL,
p.value = TRUE,
nperm = 1000,
p.value_asymmetry = FALSE,
nboot = 1000,
print = TRUE,
remove.00 = FALSE,
...
)
## S3 method for class 'numeric'
qad(
x,
y,
resolution = NULL,
p.value = TRUE,
nperm = 1000,
p.value_asymmetry = FALSE,
nboot = 1000,
print = TRUE,
remove.00 = FALSE,
...
)
Arguments
x |
a data.frame containing two columns with the observations of the bi-variate sample or a (non-empty) numeric vector of data values |
... |
Further arguments passed to 'qad' will be ignored |
resolution |
an integer indicating the number of strips for the checkerboard aggregation (see ECBC). We recommend to use the default value (resolution = NULL) |
p.value |
a logical indicating whether to return a p-value of rejecting independence (based on permutation). |
nperm |
an integer indicating the number of permutation runs (if p.value = TRUE) |
p.value_asymmetry |
a logical indicating whether to return a (heuristic) p-value for the measure of asymmetry (based on bootstrap). |
nboot |
an integer indicating the number of runs for the bootstrap. |
print |
a logical indicating whether the result of qad is printed. |
remove.00 |
a logical indicating whether double 0 entries should be excluded (default = FALSE) |
y |
a (non-empty) numeric vector of data values. |
Details
qad is the implementation of a strongly consistent estimator of the copula based dependence measure zeta_1 introduced in Trutschnig 2011. We first compute the empirical copula of a two-dimensional sample, aggregate it to the so called empirical checkerboard copula (ECBC), and calculate zeta_1 of the ECBC and its transpose. In order to test for independence (in both directions), a built-in p-value is implemented (a permutation test with nperm permutation runs to estimate the p-value). Furthermore, a (heuristic) bootstrap test with nboot runs can be applied to estimate a p-value for the measure of asymmetry a.
Value
qad returns an object of class qad containing the following components:
data |
a data.frame containing the input data. |
q(X , Y) |
influence of X on Y |
q(Y , X) |
influence of Y on X |
max.dependence |
maximal dependence |
results |
a data.frame containing the results of the dependence measures. |
mass_matrix |
a matrix containing the mass distribution of the empirical checkerboard copula. |
resolution |
an integer containing the used resolution of the checkerboard aggregation. |
n |
Sample size. |
References
Trutschnig, W. (2011). On a strong metric on the space of copulas and its induced dependence measure, Journal of Mathematical Analysis and Applications 384, 690-705.
Junker, R., Griessenberger, F. and Trutschnig, W. (2021). Estimating scale-invariant directed dependence of bivariate distributions. Computational Statistics and Data Analysis, 153.
See Also
A tutorial can be found at http://www.trutschnig.net/software.html.
Examples
#Example 1 (independence)
n <- 100
x <- runif(n,0,1)
y <- runif(n,0,1)
sample <- data.frame(x,y)
qad(sample)
###
#Example 2 (mutual complete dependence)
n <- 500
x <- runif(n,0,1)
y <- x^2
sample <- data.frame(x,y)
qad(sample)
#Example 3 (complete dependence)
n <- 1000
x <- runif(n,-10,10)
y <- sin(x)
sample <- data.frame(x,y)
qad(sample)
#Example 4 (Asymmetry)
n <- 100
x <- runif(n,0,1)
y <- (2*x) %% 1
qad(x, y)