rcd: Calculate robust copula dependence

Description Usage Arguments Value Examples

View source: R/rcd.R

Description

This is the function that used to calculate the robust copula dependence (RCD) between two random variables x and y. Note that the length of x and y should be the same.

Usage

1
rcd(x, y, method = "knn", k, bandwidth, M = 200, cpp = "parallel")

Arguments

x

The vector for the first random variable

y

The vector for the first random variable

method

The method used in density estimation, i.e. knn or kde.

k

The parameter K in KNN density estimation. This parameter could be missing and a default value will be applied.

bandwidth

The bandwidth used in the density estimation. This parameter could be missing and a default value will be applied.

M

Number of steps used in numerical integration. This parameter could be missing and a default value will be applied.

cpp

The ways to calculate the distance matrix. "none" means using R distance function, "serial" means using serial version of Rcpp, "parallel" means using parallel version of Rcpp.

Value

The RCD of x and y

Examples

1
2
3
4
n <- 1000
 x <- runif(n)
 y <- x^2 + 2*runif(n)
 rcd(x,y,method="kde")

liyi-1989/rcd documentation built on May 21, 2019, 7:32 a.m.