KPCgraph: Kernel partial correlation with geometric graphs In KPC: Kernel Partial Correlation Coefficient

Description

Calculate the kernel partial correlation (KPC) coefficient with directed K-nearest neighbor (K-NN) graph or minimum spanning tree (MST).

Usage

 1 2 3 4 5 6 7 8 KPCgraph( Y, X, Z, k = kernlab::rbfdot(1/(2 * stats::median(stats::dist(Y))^2)), Knn = 1, trans_inv = FALSE )

Arguments

 Y a matrix (n by dy) X a matrix (n by dx) or NULL if X is empty Z a matrix (n by dz) k a function k(y, y') of class kernel. It can be the kernel implemented in kernlab e.g. Gaussian kernel: rbfdot(sigma = 1), linear kernel: vanilladot(). Knn number of nearest neighbor to use; or "MST" trans_inv TRUE or FALSE. Is k(y, y) free of y?

Details

The kernel partial correlation squared (KPC) measures the conditional dependence between Y and Z given X, based on an i.i.d. sample of (Y, Z, X). It converges to the population quantity (depending on the kernel) which is between 0 and 1. A small value indicates low conditional dependence between Y and Z given X, and a large value indicates stronger conditional dependence. If X == NULL, it returns the KMAc(Y,Z,k,Knn), which measures the unconditional dependence between Y and Z. Euclidean distance is used for computing the K-NN graph and the MST.

Value

The algorithm returns a real number which is the estimated KPC.