pairwise_direction: Copula-based direction for a single pair

Description Usage Arguments Details Value Examples

Description

Copula-based direction for a single pair

Usage

1
pairwise_direction(x, y = NULL, cop = NULL, ...)

Arguments

x

a numeric vector, bivariate matrix or data frame.

y

NULL (default) or a vector with compatible dimensions to x.

cop

NULL (default) or a bicop_dist object.

...

additional arguments passed to bicop

Details

Assuming that either (a) X := N_X and Y = f(X, N_Y) or (b) Y := N_Y and X = f(Y, N_X), where N_X and N_Y are independent noise processes, this copula-based method recovers the direction, namely (a) X -> Y or (b) Y -> X.

Value

TRUE if X -> Y and FALSE if Y -> X

Examples

1
2
3
4
5
6
7
8
# Y = X^2 + N_Y with Gaussian noises
n <- 1e3
NX <- rnorm(n)
NY <- rnorm(n)
X <- NX
Y <- X^2 + NY

pairwise_direction(X, Y)

tvatter/copulaDAG documentation built on May 20, 2019, 10:23 p.m.