least squares fitting logarithmic