Given two column-vectors, A = [0; 1.6818; 2.8284; 3.8337; 4.7568; 5.6234]
and B = [0; 984.7; 1590.7; 2029.1; 2251.9; 2254.45]
, I need to find a scalar x, such that it satisfies the following condition:
$Ax = B$
Using Matrix calculation, it can be easily solved as follows:
$ \boldsymbol{A}x = \boldsymbol{B}\\ \implies x = \boldsymbol{A}^{-1}\boldsymbol{B} \\ \implies x = {(\boldsymbol{A^T}\boldsymbol{A})}^{-1}\boldsymbol{A^T}\boldsymbol{B} \\ \textrm{(Taking pseudo-inverse of A)} $
Solving this gives x = 467.8599
.
Which is correct, since I verified it in MATLAB using:
x = A\B
x = linsolve(A, B)
Now my question is, can I obtain the same result if I approach this problem as finding a least square solution of the regression Ax = B. That is, can I obtain x = 467.8599
by minimizing for E
where,
$E = \frac{1}{2}\sum_{n=1}^{6}{{\{A_nx - B_n\}}^2}$
If yes, can you please explain how.
Also let me know if there is some mistake in my understanding. Thanks in advance.