KMAc {KPC} | R Documentation |
KMAc (the unconditional version of graph-based KPC) with geometric graphs.
Description
Calculate (the unconditional version of graph-based KPC) using directed K-NN graph or minimum spanning tree (MST).
Usage
KMAc(
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 for an accurate estimate of the population KMAc. |
Details
is an estimate of the population kernel measure of association, based on data
from
.
For K-NN graph, ties will be broken at random. MST is found using package
emstreeR
.
In particular,
where denotes a MST or K-NN graph on
,
denotes the set of edges of
and
implies that there is an edge from
to
in
.
Euclidean distance is used for computing the K-NN graph and the MST.
Value
The algorithm returns a real number ‘KMAc’, the empirical kernel measure of association
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)
KMAc(Y = rnorm(100), X = rnorm(100), k = rbfdot(1), Knn = 1)