Klin {KPC} | R Documentation |
A near linear time analogue of KMAc
Description
Calculate (the unconditional version of graph-based KPC) using directed K-NN graph or minimum spanning tree (MST).
The computational complexity is O(nlog(n))
Usage
Klin(
Y,
X,
k = kernlab::rbfdot(1/(2 * stats::median(stats::dist(Y))^2)),
Knn = 1
)
Arguments
Y |
a matrix of response (n by dy) |
X |
a matrix of predictors (n by dx) |
k |
a function |
Knn |
the number of K-nearest neighbor to use; or "MST". A small Knn (e.g., Knn=1) is recommended. |
Details
is an estimate of the population kernel measure of association, based on data
from
.
For K-NN graph,
can be computed in near linear time (in
).
In particular,
,
where all symbols have their usual meanings as in the definition of .
Euclidean distance is used for computing the K-NN graph and the MST.
Value
The algorithm returns a real number ‘Klin’: an empirical kernel measure of association which can be computed in near linear time when K-NN graphs are used.
References
Deb, N., P. Ghosal, and B. Sen (2020), “Measuring association on topological spaces using kernels and geometric graphs” <arXiv:2010.01768>.
See Also
Examples
library(kernlab)
Klin(Y = rnorm(100), X = rnorm(100), k = rbfdot(1), Knn = 1)