Numerical methods for non-linear least squares