rdc: Randomized Dependence Coefficient (RDC)

Description Usage Arguments Details Examples

View source: R/rdc.R

Description

This function calculates the Random Dependence Coefficient (RDC). Calculate the dependence between the random samples as the highest canonical correlation between the k random non-linear projections of their copula transformations.

Usage

1
rdc(x, y, k = 20, s = 1/6, f = sin)

Arguments

x

A vector, matrix or numeric data frame

y

A vector, matrix or numeric data frame

k

Number of non-linear projections of the copula, by default k = 20

s

Variance to draw i.i.d. projection coefficients in N ~(0, sI), by defect is 1/6

f

Function that is used for the generation of random non-linear projections, if it is not indicated it uses the sinusoidal projections (sin)

Details

It also provides the p-value for the independence hypothesis, assuming the normality of the data through the Bartlett's approximation.

Examples

1
2
3
4
5
6
7
8
9
#Lineal dependence
x<-rnorm(200, sd=2.5)
y<-2*x+rnorm(200, sd=2.5)
rdc(x,y)

#No dependency
x<-rnorm(200, mean=2, sd =1.8)
y<-rnorm(200, mean=0, sd =2.5)
rdc(x,y)

AnaBPazos/AlterCorr documentation built on May 20, 2019, 4:24 p.m.