detectbound function

Detect bounds for density function