I want to find a curve of the form $y = a + b \sqrt{x}$ that best fits the points: $(3, 1.5)$, $(7, 2.5)$ and $(10, 3)$ by substituting the $x$ vector $= \sqrt{x}$
My understanding of the process to find the least squares approximation was that the $x$ vector contained the unknown variables so you could use guassian elimination to find the variables $a$,$b$ from: $A^t A x = A^t B$ but I am unsure how this would work when the $x$ vector is already given and you want to find $a$,$b$ still.
The points are given as $(x_i, y_i)$ and one has the unknowns $a$, $b$ which need to be optimized: $$ y_i = a + b \sqrt{x_i} \quad (i \in \{1,2,3\}) \iff \\ A x = y $$ with $$ x = (a, b)^t \in \mathbb{R}^2, \quad y = (y_i) \in \mathbb{R}^3, \quad A = (a_{ij}) \in \mathbb{R}^{3\times 2}, \quad a_{i1} = 1, \quad a_{i2} = \sqrt{x_i} \quad (i \in \{1,2,3\}) $$ gives $$ A x = y \iff \left( \begin{matrix} 1 & \sqrt{x_1} \\ 1 & \sqrt{x_2} \\ 1 & \sqrt{x_3} \end{matrix} \right) \left( \begin{matrix} a \\ b \end{matrix} \right) = \left( \begin{matrix} y_1 \\ y_2 \\ y_3 \end{matrix} \right) $$ $A$ is overspecified (more equations than unknowns), so the matrix is not square and can not be inverted. However $$ A^t A x = A^t y \Rightarrow x = (A^tA)^{-1} A^t y $$ can be shown to give a solution with minimal error in the $2$-norm, which is the standard, Euclidean norm.
I get $x = (-0.31587, 1.05405)^t$ which gives $Ax = (1.5098, 2.4729, 3.0173)^t$ and $\delta = \lVert Ax-y \rVert = 0.033639$, which seems reasonable.
Graph of $f(x) = a + b \sqrt{x}=−0.31587+ 1.05405\sqrt{x}$.