Orthogonality by Singular value decomposition "svd"
14 次查看(过去 30 天)
显示 更早的评论
How to use the Singular value decomposition "svd" to perform the Orthogonalization between vectors?
3 个评论
Torsten
2023-1-27
移动:John D'Errico
2023-1-27
Never heard of this method. According to the literature link, it seems to be strongly coupled with a physics application. So I suggest you read the article referenced if you think it might be of help for your application, too.
Löwdin, Per-Olov (1970). "On the nonorthogonality problem". Advances in quantum chemistry. Vol. 5. Elsevier. pp. 185–199.
回答(1 个)
John D'Errico
2023-1-27
Seems easy enough.
A = randi(5,[5,3])
rank(A)
So A is a simple matrix, with rank 3. There are 3 vectors that would form a basis for the column space of A.
Using the SVD, can we find such a set of vectors? Yes.
[U,S,V] = svd(A,0);
U
The matrix U is exactly what you want. The vectors are orthonormal (so both orthogonal and having unit norm.)
U'*U
We get an identity matrix. (To within floating point trash. the -0.0000 elements are all essentially on the order of +/- eps.)
And U has the property that they span the column space of A. So ANY of the columns of A can be represented as some linear combination of the columns of U. The SVD essentially provides the transformation to orthogonality you seem to be asking to get. If you want, it has orthognalized the columns of A.
2 个评论
John D'Errico
2023-1-27
编辑:John D'Errico
2023-1-27
What does it mean to have a matrix orthogonalized with a vector? I'm sorry, but that statement makes little mathematical sense. As well, what are you talking about in terms of an orthogonalization test?
If you want better help, then you need to ask meaningful questions. Sorry, but true. It seems as if you are throwing around a lot of jargon that you don't really understand. Perhaps this is what you are asking:
X = 1:5;
Xnull = null(X)
V is a vector. And the matrix Vnull is a set of vectors that span the nullspace of V. Two vectors ar e orthogonal if their dot product is zero. Is that the test you were asking about?
X*Xnull
As you should see, the dot products of X with each of the vectors in Xnull are zero, to within floating point trash.
Xnull'*Xnull
As well, you should see this is the 4x4 identity matrix, so we see that Xnull is indeed a set of orthonormal vectors.
I used NULL to do the work. But if you look carefully at the code for NULL (it is not built-in), you would see it just calls SVD. I could also have done this:
[U,S,V] = svd(X');
Now the set of nullspace vectors are just given as
U(:,2:end)
As you can see, this is what null returns. And null just uses SVD anyway. So just use null, if that is what you need.
I'm only making random guesses here, since I have no idea what you are really asking.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!