given data and number of clusters K, choose a bandwidth from a grid according to the MATR algorithm
matr(dat, k, grid, tol = 0.01)A list with two elements. The first, l, contains the trace value for
each of the values in grid. The second, best, contains the best value.
data vector
number of clusters
parameter grid to search on
tolerence for choosing the "best" sigma values. Reducing the tolerance will give larger values of the bandwidth parameter