DGELS 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}}^{}$

where

A = $\displaystyle \left(\vphantom{
\begin{array}{rrrr}
-0.57 & -1.28 & -0.39 & 0....
...5 & 0.30 & 0.15 & -2.13 \\
-0.02 & 1.03 & -1.43 & 0.50
\end{array} }\right.$$\displaystyle \begin{array}{rrrr}
-0.57 & -1.28 & -0.39 & 0.25 \\
-1.93 & 1...
...\\
0.15 & 0.30 & 0.15 & -2.13 \\
-0.02 & 1.03 & -1.43 & 0.50
\end{array}$$\displaystyle \left.\vphantom{
\begin{array}{rrrr}
-0.57 & -1.28 & -0.39 & 0....
...5 & 0.30 & 0.15 & -2.13 \\
-0.02 & 1.03 & -1.43 & 0.50
\end{array} }\right)$  and  b = $\displaystyle \left(\vphantom{
\begin{array}{r}
-2.67 \\
-0.55 \\
3.34 \\
-0.77 \\
0.48 \\
4.10
\end{array} }\right.$$\displaystyle \begin{array}{r}
-2.67 \\
-0.55 \\
3.34 \\
-0.77 \\
0.48 \\
4.10
\end{array}$$\displaystyle \left.\vphantom{
\begin{array}{r}
-2.67 \\
-0.55 \\
3.34 \\
-0.77 \\
0.48 \\
4.10
\end{array} }\right)$.

Example program
Example data
Example results