ENH: add least-squares histogram fitting