Title: Advanced mathematical treatment of least squares in economic applications