Find the parameters $a,b$ such that the distance of all the points of a subset of $\mathbb{R^2}$ to the line $y=ax+b$ is minimal

61 Views Asked by At

Let $A\subset \mathbb{R^2} $ be a non-empty, finite set. We define a function $f:\mathbb{R^2}\rightarrow\mathbb{R},$ $f(a,b)=\sum_{(x,y)\in A}||y-ax-b||^2$. Find the global minimum of this function.

This should also be a function that describes the distance of all the points in the set $A$ to the line $y=ax+b$. My questions are:

  1. Why are we using the norm notation when all the variables are in $\mathbb{R}$?
  2. I'm not even sure if I get the geometrical interpretation right. Should the lines $y=ax+b$ be all the parallel lines "going through" the set $A$?
  3. Is it a right take on this question if I try and find the partial derivatives and look at the values $a,b$ for which they are equal to $0$?

Thanks in advance!

1

There are 1 best solutions below

2
On BEST ANSWER

Let us start by saying that this is not the distance from all points to the line $y= ax +b$. You can see it be considering $(a=1, b=0)$ and $A=\{(0, 2)\}$. The distance from the line $y = x$ to the point $(0,2)$ is $\sqrt{2}$ (try drawing this one out, draw a line that is perpendicular to $y=x$ that goes through the point $(0,2)$.) What you are computing is the vertical distance between $(ax +b)$ and $y$ for some given $x,y$ (and in our example, this distance would be $2$).

As for the other questions, 1. it is a notation mistake indeed, 2. In a bit of a vague sense, you are trying to draw a line that goes through the middle of the set. 3. That would also be my approach!