Least square linear approximation

This post explains how to make linear approximation with a simple example. Let’s assume we want to approximate a point cloud with a linear function : .

The point cloud is given by points with coordinates . The aim is to estimate and where will fit the point cloud as mush as possible. We want to minimize for each point the difference between and , ie. we want to minimize . The matrix form of the system is given by: