Chapter Contents Previous Next
 Language Reference

## SVD Call

computes the singular value decomposition

CALL SVD( u, q, v, a);

In the SVD subroutine:
a
is the input matrix that is decomposed as described below.

u, q, and v
are the returned decomposition matrices.
The SVD subroutine decomposes a real m ×n matrix A (where m is greater than or equal to n) into the form
A = U diag(Q)V'
where
U' U = V' V = VV' = In
and Q contains the singular values of A. U is m ×n, Q is n ×1, and V is n ×n.

When m is greater than or equal to n, U consists of the orthonormal eigenvectors of AA', and V consists of the orthonormal eigenvectors of A' A. Q contains the square roots of the eigenvalues of A' A and AA', except for some zeros.

If m is less than n, a corresponding decomposition is done where U and V switch roles:
A = U diag(Q)V'
but
U' U = UU' = V' V = Iw   .
The singular values are sorted in descending order.

For information about the method used in the SVD subroutine, refer to Wilkinson and Reinsch (1971). Consider the following example (Wilkinson and Reinsch 1971, p. 149):

```   a={22  10   2   3   7,
14   7  10   0   8,
-1  13  -1 -11   3,
-3  -2  13  -2   4,
9   8   1  -2   4,
9   1  -7   5  -1,
2  -6   6   5   1,
4   5   0  -2   2};
call svd(u,q,v,a);
```
The results are
```      U             8 rows      5 cols    (numeric)

0.7071068 0.1581139 -0.176777  -0.06701  0.279804
0.5303301 0.1581139 0.3535534 -0.045208 -0.645372
0.1767767 -0.790569 0.1767767 0.5368704 -0.060458
0 0.1581139 0.7071068 0.1086593  0.592536
0.3535534 -0.158114         0 -0.228736 0.2300372
0.1767767 0.1581139  -0.53033 0.5116134  0.212316
0 0.4743416 0.1767767 0.5867386 -0.102189
0.1767767 -0.158114         0 -0.187346 0.2049688

Q             5 rows      1 col     (numeric)

35.327043
20
19.595918
1.281E-15
3.661E-16

V             5 rows      5 cols    (numeric)

0.8006408 0.3162278 -0.288675 0.4190955         0
0.4803845 -0.632456         0 -0.440509 -0.418548
0.1601282 0.3162278 0.8660254 0.0520045  -0.34879
0 0.6324555 -0.288675 -0.676059 -0.244153
0.3202563         0 0.2886751 -0.412977 0.8022171
```

 Chapter Contents Previous Next Top