As an alternative to conventional KDE where a single value of \(h\)  is
chosen, a generalization of the method, called adaptive KDE, allows a
different bandwidth value for each data point. In such cases,
Eq.(REF ) is not strictly valid. To avoid confusions, the
reader interested in observing how this equation is modified can refer
to Eq. (6.84) in Ref. [1]}. In adaptive KDE the
value of the bandwidth depends on each data point by a defined
criterion [2]}. The one of interest to this work is to use the
k-Nearest Neighbor (kNN) algorithm to select the bandwidth \(h_i\)  for
each data point \(\mathbf {x}_i\) , taking \(h_i\)  as the distance to the
\(k\) -th nearest neighbor of the data point.
