This function returns the p-value of a bivariate asymptotic independence test based on Kendall's \(\tau\).
BiCopIndTest(u1, u2)
Data vectors of equal length with values in \([0,1]\).
Test statistic of the independence test.
P-value of the independence test.
The test exploits the asymptotic normality of the test statistic
$$\texttt{statistic} := T =
\sqrt{\frac{9N(N - 1)}{2(2N + 5)}} \times |\hat{\tau}|, $$
where \(N\) is the number of observations (length of u1
) and
\(\hat{\tau}\) the empirical Kendall's tau of the data vectors u1
and u2
. The p-value of the null hypothesis of bivariate independence
hence is asymptotically
$$\texttt{p.value} = 2 \times \left(1 - \Phi\left(T\right)\right), $$
where \(\Phi\) is the standard normal distribution function.
Genest, C. and A. C. Favre (2007). Everything you always wanted to know about copula modeling but were afraid to ask. Journal of Hydrologic Engineering, 12 (4), 347-368.
set.seed(123)
## Example 1: Gaussian copula with large dependence parameter
cop <- BiCop(1, 0.7)
dat <- BiCopSim(500, cop)
# perform the asymptotic independence test
BiCopIndTest(dat[, 1], dat[, 2])
#> $statistic
#> [1] 14.92841
#>
#> $p.value
#> [1] 0
#>
## Example 2: Gaussian copula with small dependence parameter
cop <- BiCop(1, 0.01)
dat <- BiCopSim(500, cop)
# perform the asymptotic independence test
BiCopIndTest(dat[, 1], dat[, 2])
#> $statistic
#> [1] 1.611854
#>
#> $p.value
#> [1] 0.1069937
#>