The following derivation is inspired by Bruce E. Hansen’s “Lecture Notes on Nonparametric” (2009). If you are interested in learning more, you can consult his original lecture notes. here.
Suppose we want to estimate a probability density function, f