Least Square of Multiple Lines If a line can be described as $$ y = mx + c $$ and we have multiple lines, we can have these lines described in matrix form
$$\begin{bmatrix}1 & -m_1\\1 & -m_2\\ \vdots & \vdots\\1 & -m_n\end{bmatrix}\begin{bmatrix}y \\ x\end{bmatrix}=\begin{bmatrix} c_1\\ c_2\\ \vdots\\ c_n\end{bmatrix} $$
I can get the value of $x$ and $y$ by using least square method. But when we have noise in calculation such as
$$\begin{bmatrix}1 & -m_1+\delta_1\\1 & -m_2+\delta_2\\ \vdots & \vdots\\1 & -m_n+\delta_n\end{bmatrix}\begin{bmatrix}\hat{y} \\ \hat{x}\end{bmatrix}=\begin{bmatrix} c_1+\epsilon_1\\ c_2+\epsilon_2\\ \vdots\\ c_n+\epsilon_n\end{bmatrix} $$
can we calculate the deviation of $\hat{x}$ and $\hat{y}$ from $x$ and $y$ (or is there any other way to describe that problem)?
Thanks
 A: I'm not sure about what you wrote, but here is the usual setup.
Assume a set of $m$ data points $\{(x^{(1)}, y^{(1)}), \dots, (x^{(m)}, y^{(m)})\}$, where $x^{(i)}$ can be viewed as inputs to some function and $y^{(i)}$ as the corresponding outputs. The model assumed is the following
$$
y = f(x; \theta)+n
$$
where $f(x;\theta)$ is a function of the input data and some parameter vector $\theta$, and $n$ is noise (error).
For simplicity, assume $m=3$ and $f(x;\theta) = \theta_0 + \theta_1 x$. Hence, we can write
$$
y^{(1)} = \theta_0 + \theta_1 x^{(1)} + n^{(1)} \\
y^{(2)} = \theta_0 + \theta_1 x^{(2)} + n^{(2)} \\
y^{(2)} = \theta_0 + \theta_1 x^{(3)} + n^{(3)} \\
$$
or equivalently, in matrix-vector form
$$
y_d = 
\begin{bmatrix}
1 & x^{(1)}\\
1 & x^{(2)}\\
1 & x^{(2)}
\end{bmatrix}
\begin{bmatrix}
\theta_0 \\
\theta_1
\end{bmatrix}
+ n_d
= 
X_d \theta + n_d
$$
where subscript $d$ is put to emphasize that the elements correspond to "data" (in contrast to model).
Now, in least-squares the goal is to find $\theta$ minimizing $||n_d||^2 = ||y_d - X_d \theta||^2$. That is, to solve
$$
\min_\theta ||y_d - X_d \theta||^2,
$$
hence, the name least-squares, i.e., you seek the minimum (least) of the (sum of) squares since $||n_d||^2 = (n^{(1)})^2 + (n^{(2)})^2 + (n^{(3)})^2$.
One can show that the solution to this problem is given by
$$\theta = X_d^{+} y_d$$
where $X_d^{+}$ denotes the Moore-Penrose pseudo inverse of $X_d$.
