I am trying to do some experiment in MATLAB but I am getting some contradictory results. Assume we plan to solve a least square problem, $Ax=b$, as follow:
-$A$ is $m \times n$ vandermonde matrix. The entries are populated using $m$ value between $0$ to $1$(given as input).
-The corresponding vector $b$ calculated using an original function that we would like to estimate
-$\text{compute SVD using } A=U\Sigma V^*$
-$\text{compute } U^{*}b$
-$\text{Solve } \Sigma w=U^{*}b \text{ for w}$
-$x=Vw$
Now, using MATLAB, computed $x$ from SVD are subsittued in $Ax$. The result is plotted and it is pretty close to original $b$. But if I use polyval function of degree($n-1$) (in MATLAB) the resulting plot is significantly different from the original one. I cannot understand the reason for such a significant difference between the results of these two methods. Which one is more reliable as an indicator of SVD performance?
Any insight would be appreciated. Thank you.
You should use MATLAB
pinv()function which solves Least Squares problem using the SVD.This method is slower yet much more robust than using
\(It always returns the least norm solution).By itself it can handle problems with large condition number.
If you are dealing with edge cases (Really extreme condition number) you should use the
tolparameter.