least-squares error estimation