Least Squares Approximation

This calculates the least squares solution of the equation AX=B by solving the normal equation ATAX = ATB. Note: this method requires that A not have any redundant rows.

A

B