Description Usage Arguments Value References Examples

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).

1 | ```
L2OptW(k, d)
``` |

`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. |

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

BSY2017IndepTest

1 2 3 4 5 6 7 8 9 | ```
# 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
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.