Re: SingularValues of symmetric real matrix not converging
- To: mathgroup at smc.vnet.net
- Subject: [mg25769] Re: [mg25759] SingularValues of symmetric real matrix not converging
- From: "Mark Harder" <harderm at ucs.orst.edu>
- Date: Sun, 22 Oct 2000 23:30:04 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Albert,
I hope someone else answers this, too, because I use SingularValues[]
all the time, and I can't figure out exactly *why* it won't converge.
Obviously, the matrix is a difficult one to work with, since most elements
differ only in the 17-th & 18-th decimal places; but I would have thought
that evaluating SVD in high precision would handle that:
In[151]:=
N[SingularValues[mat], 32]
SingularValues::"cfail": "Algorithm failed to converge."
O.K., so I looked up the error message with the Help facility -- no luck
here either; Mathematica with typical grace & aplomb omits this message from
its help file.
So I tried scaling the matrix by multiplying it by 10^15:
SingularValues[1. 10^15 mat]
& this returned Transpose [U-matrix], the vector of s-values, and
Transpose[V-matrix], but only in the rank-7 approximation. That is because
SVD does indeed have a tolerance flag which omits singular values that are
too small, and the U- and V- elements that correspond to those omitted
s-values. So, to return *all* elements of the SVD of mat, use
SingularValues[1. 10^15 mat, Tolerance -> 0 ]
, which returns
{1.84975`*^14, 1.84975`*^14, 1.84975`*^14, 1.84975`*^14, \
1.8497499999999997`*^14, 1.8497499999999988`*^14, 1.8497499999999988`*^14, \
3.1778373115434495`}
as the vector of singular values. See the documentation for
SingularValues[], which explains how to get the condition number of mat from
the above s-vector.
To get mat back, we need U.DiagonalMatrix[s].V^T, rescaled by dividing s by
10^15:
N[Transpose[utr].DiagonalMatrix[1. 10^-15 sv].vee, 32 ]
{{0.161853, -0.0231219, -0.0231219, -0.0231219, -0.0231219, -0.0231219, -0.0
231219, -0.0231219},
{-0.0231219, 0.161853, -0.0231219,.....},