Computes an orthonormal basis of an array using SVD.
ORTH(a)
a - An input array.
An orthonormal array of n columns where n == rank(a).
W1: {{1, 3},
{2, 2},
{3, -1}}
W2: orth(W1)
W2 == {{-0.666667, -0.447214},
{-0.666667, 0.000000},
{-0.333333, 0.894427}}
Since W2 is an orthonormal basis for W1,
col(w2, 1)' *^ col(w2, 1) == {1}
i.e. column 1 is orthonormal to itself.
col(w2, 1)' *^ col(w2, 2) == {-1.665335E-016}
i.e. column 1 and column 2 are orthogonal.
w2' *^ w2 == {{1, 0},
{0, 1}}
i.e. the identity matrix.
Now construct a new series that is a linear combination of the original series:
W3: 2*col(w1, 1) - 5*col(w1, 2)
returns {-13, -6, 11}.
W3 can also be expressed as a linear combination of W2, the orthonormal basis:
a1 = w3' *^ col(w2, 1)
a2 = w3' *^ col(w2, 2)
W4: a1 * col(w2, 1) + a2 * col(w2, 1)
a1 == {9.0}
a2 == {15.652476}
W4 == {-13, -6, 11}
ORTH uses SVD to compute the orthonormal basis. The number of output columns is limited to the RANK of the input array.