DGELSS Example

To solve the linear least squares problem

$\displaystyle \min_{{x}}^{}$$\displaystyle \left\Vert\vphantom{ b - A x }\right.$b - Ax$\displaystyle \left.\vphantom{ b - A x }\right\Vert _{{2}}^{}$

for the solution, x, of minimum norm, where

A = $\displaystyle \left(\vphantom{
\begin{array}{rrrrr}
-0.09 & 0.14 & -0.46 & 0....
...13 & 0.14 & 1.74 \\
-1.59 & -0.72 & 1.06 & 1.24 & 0.34
\end{array} }\right.$$\displaystyle \begin{array}{rrrrr}
-0.09 & 0.14 & -0.46 & 0.68 & 1.29 \\
-1...
....55 & -1.13 & 0.14 & 1.74 \\
-1.59 & -0.72 & 1.06 & 1.24 & 0.34
\end{array}$$\displaystyle \left.\vphantom{
\begin{array}{rrrrr}
-0.09 & 0.14 & -0.46 & 0....
...13 & 0.14 & 1.74 \\
-1.59 & -0.72 & 1.06 & 1.24 & 0.34
\end{array} }\right)$  and  b = $\displaystyle \left(\vphantom{
\begin{array}{r}
7.4 \\
4.2 \\
-8.3 \\
1.8 \\
8.6 \\
2.1
\end{array} }\right.$$\displaystyle \begin{array}{r}
7.4 \\
4.2 \\
-8.3 \\
1.8 \\
8.6 \\
2.1
\end{array}$$\displaystyle \left.\vphantom{
\begin{array}{r}
7.4 \\
4.2 \\
-8.3 \\
1.8 \\
8.6 \\
2.1
\end{array} }\right)$.

A tolerance of 0.01 is used to determine the effective rank of A.

Example program
Example data
Example results