estimate the error when do the histogram