Least squares method to find radius of a circle I really don't know how to start/solve the following problem, any help is appreciated
Here is the question:
It consists of a and b, I already solved a 
a) Let $A∈ℝ^{m*n}$ and $b∈ℝ^{m}$ with $rank(A)=n$. Suppose x is the solution for the least squares problem given by $A$ and $b$. 
Show that: $||Ax-b||^2=b^T(I_m-A(A^TA)^{-1})b$
I proved this is the case so now it can be used as a given
b)By using least squares method, find the best circle of the form $x^2+y^2=r^2$ representing the pairs $(x_i,y_i)$ for $i=1,2,...,n$
 A: The only freedom is given by the radius of the circle and in the perfect case you would have that all points lie on it, or that $x_i^2+y_i^2=r^2=:R$ for all data points. Consequently we would like to have
\begin{align*}
  \begin{bmatrix}
  1\\1\\ \vdots \\ 1
  \end{bmatrix}
  R=\begin{bmatrix}
  x_1^2+y_1^2\\
  x_2^2+y_2^2\\
  \vdots\\
  x_n^2+y_n^2\\
  \end{bmatrix}.
 \end{align*}
    This does not have a solution generally, so we take the least squares approach. Multiplying both sides by $\begin{bmatrix}1&1& \cdots & 1
 \end{bmatrix}$ for the normal equation(s) yields
    \begin{align*}
  nR=\sum_{i=1}^{n}\left(x_i^2+y_i^2\right).
 \end{align*}
    So the desired circle has radius equal to $r=\sqrt{R}=\sqrt{\dfrac{1}{n}\sum_{i=1}^{n}\left(x_i^2+y_i^2\right)}$.
N.B.: I think you should eventually start solving your homework yourself, especially considering your question history. I will not be the one responsible, but you might get in trouble some day if you keep doing this.
A: @Brayan Shali has posted the least squares solution $R=\mathbf{A}^{\dagger}b$. The pseudoinverse for a vector 
$$
 v^{\dagger} = \frac{v^{*}}{\lVert v \rVert}.
$$
That is, the average value is the least squares solution.
