A robust method to estimate the b-value of the magnitude–frequency distribution of earthquakes