// Take an array of points and returns a set of smoothed points by applying a filter (specified by the kernel function) to the data // * This function cuts off the kernel calculations after the kernel decreases beyond a certain level // * @returns {array} - an array with the new points // */ var ssci = ssci || {}; ssci.smooth = {}; ssci.smooth.kernel2 = function(){ var output=[]; var max_diff = 0.001; //Maximum difference to calculate kernel - equivalent to 0.1% // var scale = 0.3; var data = []; var kernel = "Gaussian"; var i, j; //Iterators var x_conv = function(d){ return d[0]; }; var y_conv = function(d){ return d[1]; }; function sk() { var dataArray = []; output = []; //Create array of data using accessors dataArray = data.map( function(d){ return [x_conv(d), y_conv(d)]; }); //Calculate smoothed values for(i=0;i-1; j--){ temp_ker = k_U(dataArray[i][0], dataArray[j][0], scale); if(temp_ker/self_ker