code: function estimateBandwidth(array) {
    var n = array.length,
        q = quartiles(array),
        h = (q[2] - q[0]) / 1.34;
    return 1.06 * Math.min(Math.sqrt(variance(array)), h) * Math.pow(n, -0.2);
  }
docs: Scott, D. W. (1992) Multivariate Density Estimation: Theory, Practice, and Visualization. Wiley.