<prompt> Andika kazi ya c ambayo hutofautiana linear regression ya vector ya 2-d pointi.  <response>: Here is a sample C function which calculates the linear regression of a vector of 2-d points:cppinclude include using namespace std;pair linearRegressionvector points double n points.size; double sum_x 0.0, sum_y 0.0, sum_x2 0.0, sum_xy 0.0; for auto p : points sum_x p.first; sum_y p.second; sum_x2 p.first p.first; sum_xy p.first p.second; double slope n sum_xy - sum_x sum_y n sum_x2 - sum_x sum_x; double intercept sum_y - slope sum_x n; return slope, intercept;The function takes in a vector of pairs, representing the 2-d points. It then loops through each point, accumulating the sum of the x-values, y-values, squared x-values, and product of x and y. The slope and intercept of the linear regression are then calculated using those accumulated sums, and returned as a pair. 