L2OptW {IndepTest}R Documentation

L2OptW

Description

Calculates a weight vector to be used for the weighted Kozachenko–Leonenko estimator. The weight vector has minimum L_2 norm subject to the linear and sum-to-one constraints of (2) in Berrett, Samworth and Yuan (2018).

Usage

L2OptW(k, d)

Arguments

k

The tuning parameter that gives the number of neighbours that will be considered by the weighted Kozachenko–Leonenko estimator.

d

The dimension of the data.

Value

The weight vector that is the solution of the optimisation problem.

References

Berrett, T. B., Samworth, R. J. and Yuan, M. (2018). “Efficient multivariate entropy estimation via k-nearest neighbour distances.” Annals of Statistics, to appear.

Examples

# When d < 4 there are no linear constraints and the returned vector is (0,0,...,0,1).
L2OptW(100,3)    
w=L2OptW(100,4)
plot(w,type="l")
w=L2OptW(100,8);
# For each multiple of 4 that d increases an extra constraint is added.
plot(w,type="l")  
w=L2OptW(100,12)
plot(w, type="l") # This can be seen in the shape of the plot


[Package IndepTest version 0.2.0 Index]