Functions for generating and manipulating binned kernel density