Difference between revisions of "SingularValueDecomp"
Line 10: | Line 10: | ||
where ''U'' and ''V'' are orthogonal matrices and ''W'' is a diagonal matrix. ''U'' is dimensioned by ''i'' and ''j'', ''W'' by ''j'' and ''j2'', and ''V'' by ''j'' and ''j2''. In Analytica notation: | where ''U'' and ''V'' are orthogonal matrices and ''W'' is a diagonal matrix. ''U'' is dimensioned by ''i'' and ''j'', ''W'' by ''j'' and ''j2'', and ''V'' by ''j'' and ''j2''. In Analytica notation: | ||
− | Variable A := Sum(Sum(U*W, J) * Transpose(V, J, J2), J2) | + | Variable A := [[Sum]]([[Sum]](U*W, J) * [[Transpose]](V, J, J2), J2) |
The index ''j2'' must be the same size as ''j'' and is used to index the resulting ''W'' and ''V'' arrays. [[SingularValueDecomp]]() returns an array of three elements indexed by a special system index named [[SvdIndex]] with each element, ''U'', ''W'', and ''V'', being a reference to the corresponding array. | The index ''j2'' must be the same size as ''j'' and is used to index the resulting ''W'' and ''V'' arrays. [[SingularValueDecomp]]() returns an array of three elements indexed by a special system index named [[SvdIndex]] with each element, ''U'', ''W'', and ''V'', being a reference to the corresponding array. | ||
Line 16: | Line 16: | ||
Index J2 := CopyIndex(J) | Index J2 := CopyIndex(J) | ||
− | Variable SvdResult := SingularValueDecomp(A, I, J, J2) | + | Variable SvdResult := [[SingularValueDecomp]](A, I, J, J2) |
Variable U := #SvdResult[SvdIndex='U'] | Variable U := #SvdResult[SvdIndex='U'] | ||
Variable W := #SvdResult[SvdIndex='W'] | Variable W := #SvdResult[SvdIndex='W'] | ||
Variable V := #SvdResult[SvdIndex='V'] | Variable V := #SvdResult[SvdIndex='V'] | ||
+ | |||
+ | = See Also = | ||
+ | |||
+ | * [[EigenDecomp]]( ) | ||
+ | * [[Decompose]] | ||
+ | * [[:Category:Matrix Functions]] |
Revision as of 20:04, 15 January 2009
Computes the singular value decomposition of a matrix.
SingularValueDecomp(a, i, j, j2)
SingularValueDecomp() (singular value decomposition) is often used with sets of equations or matrices that are singular or ill-conditioned (that is, very close to singular). It factors a matrix a, indexed by i and j, with Size(i)>=Size(i), into three matrices, U, W, and V, such that:
- a = U . W . V
where U and V are orthogonal matrices and W is a diagonal matrix. U is dimensioned by i and j, W by j and j2, and V by j and j2. In Analytica notation:
Variable A := Sum(Sum(U*W, J) * Transpose(V, J, J2), J2)
The index j2 must be the same size as j and is used to index the resulting W and V arrays. SingularValueDecomp() returns an array of three elements indexed by a special system index named SvdIndex with each element, U, W, and V, being a reference to the corresponding array. Use the # (dereference) operator to obtain the matrix value from each reference, as in:
Index J2 := CopyIndex(J) Variable SvdResult := SingularValueDecomp(A, I, J, J2) Variable U := #SvdResult[SvdIndex='U'] Variable W := #SvdResult[SvdIndex='W'] Variable V := #SvdResult[SvdIndex='V']
Enable comment auto-refresher