Quantifies the (asymmetric) dependence structure between two random variables X and Y.
qad(x, ...)# S3 method for data.frame
qad(
x,
resolution = NULL,
permutation = FALSE,
nperm = 100,
DoParallel = TRUE,
registerC = registerDoParallel,
ncores = NULL,
print = TRUE,
...
)
# S3 method for numeric
qad(
x,
y,
resolution = NULL,
permutation = FALSE,
nperm = 100,
DoParallel = TRUE,
registerC = registerDoParallel,
ncores = NULL,
print = TRUE,
...
)
a data.frame containing two columns with the observations of the bivariate sample or a (non-empty) numeric vector of data values
Further arguments passed to 'qad' will be ignored
an integer indicating the number of strips for the checkerboard aggregation (see emp_c_copula). Default = NULL uses the optimal resolution.
a logical indicating whether a permutated p-value is computed.
an integer indicating the number of permutation runs.
a logical value indicating whether the permutation test is computed parallel.
function to register the parallel backend. It is recommended to use registerDoParallel() of the doParallel package (default). Another option for a linux based system is to install the doMC package and use registerDoMC
an integer indicating the number of cores used for parallel calculation. Default = NULL uses max(cores)-1
a logical indicating whether the result is printed into the console.
a (non-empty) numeric vector of data values.
qad returns an object of class qad containing the following components:
a data.frame containing the input data.
a data.frame containing the results of the dependence measures.
a matrix containing the mass distribution of the empirical checkerboard copula.
an integer containing the used resolution of the checkerboard aggregation.
qad is 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 (ECB), and calculate zeta_1 of the ECB copula and its transpose. In order to test for equal dependence in both directions a permutation test based p-value is calculated.
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.
# NOT RUN {
#Example 1 (independence)
n <- 1000
x <- runif(n,0,1)
y <- runif(n,0,1)
sample <- data.frame(x,y)
qad(sample)
###
#Example 2 (mutual complete dependence)
n <- 1000
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)
# }
Run the code above in your browser using DataLab