For this benchmark, we will implement a naive least squares method for linear regression, which is the simplest approach to performing a regression analysis of a dependent and a explanatory variable.

The objective is to find the best-fitting straight line through a set of points that minimizes the sum of the squared offsets from the line.

The offsets come in 2 different flavors: perpendicular and vertical - with respect to the line.





As Michael Burger summarizes it nicely in his article "Problems of Linear Least Square Regression - And Approaches to Handle Them": "the perpendicular offset method delivers a more precise result but is are more complicated to handle. Therefore normally the vertical offsets are used."

Here, we will also use the method of computing the vertical offsets.