필터 지우기
필터 지우기

Orthogonality by Singular value decomposition "svd"

조회 수: 17 (최근 30일)
M
M 2023년 1월 27일
편집: John D'Errico 2023년 1월 27일
How to use the Singular value decomposition "svd" to perform the Orthogonalization between vectors?
  댓글 수: 3
M
M 2023년 1월 27일
이동: John D'Errico 2023년 1월 27일
@M I read in in the following link https://en.wikipedia.org/wiki/Orthogonalization
that one of the Methods for performing orthogonalization include:
I want to perform it for example between a matrix and vector to achieving the Orthogonality. But I dont know how to perform that.
Do you have any idea plaese?
Torsten
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
John D'Errico 2023년 1월 27일
Seems easy enough.
A = randi(5,[5,3])
A = 5×3
3 1 2 1 2 3 2 4 5 4 5 2 2 2 5
rank(A)
ans = 3
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
U = 5×3
-0.2851 0.1392 0.8395 -0.3135 -0.2300 -0.1791 -0.5693 -0.2524 -0.4040 -0.5261 0.7822 -0.1560 -0.4687 -0.5022 0.2749
The matrix U is exactly what you want. The vectors are orthonormal (so both orthogonal and having unit norm.)
U'*U
ans = 3×3
1.0000 -0.0000 -0.0000 -0.0000 1.0000 -0.0000 -0.0000 -0.0000 1.0000
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
M
M 2023년 1월 27일
편집: M 2023년 1월 27일
@John D'Errico Thank you so much.
But what if there are a matrix orthogonalized with a vector , and I want to do the orthogonalization test between them using SVD, How to do that?
John D'Errico
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)
Xnull = 5×4
-0.2697 -0.4045 -0.5394 -0.6742 0.9359 -0.0961 -0.1282 -0.1602 -0.0961 0.8558 -0.1923 -0.2403 -0.1282 -0.1923 0.7437 -0.3204 -0.1602 -0.2403 -0.3204 0.5995
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
ans = 1×4
1.0e-15 * 0.4441 0.4441 0.8882 0.8882
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
ans = 4×4
1.0000 -0.0000 -0.0000 -0.0000 -0.0000 1.0000 -0.0000 -0.0000 -0.0000 -0.0000 1.0000 -0.0000 -0.0000 -0.0000 -0.0000 1.0000
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)
ans = 5×4
-0.2697 -0.4045 -0.5394 -0.6742 0.9359 -0.0961 -0.1282 -0.1602 -0.0961 0.8558 -0.1923 -0.2403 -0.1282 -0.1923 0.7437 -0.3204 -0.1602 -0.2403 -0.3204 0.5995
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by