TnKnn: Tn with geometric graphs

View source: R/KPC.R

TnKnnR Documentation

Tn with geometric graphs

Description

Calculate T_n using directed K-NN graph or minimum spanning tree (MST).

Usage

TnKnn(Y, X, k, Knn = 1)

Arguments

Y

a matrix of response (n by dy)

X

a matrix of predictors (n by dx)

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

the number of K-nearest neighbor to use; or "MST".

Details

T_n is an estimate of E[E[k(Y_1,Y_1')|X]], with Y_1, Y_1' drawn iid from Y|X, given X. For K-NN graph, ties will be broken at random. Algorithm finding the MST is implemented the package emstreeR.

Value

The algorithm returns a real number which is the value of Tn.


KPC documentation built on Oct. 6, 2022, 1:05 a.m.

Related to TnKnn in KPC...