Find the common eigenvectors and eigenvalues between 2 matrices
古いコメントを表示
Hello,
I am looking for finding or rather building common eigenvectors matrix X between 2 matrices A and B such as :
AX=aX with "a" the diagonal matrix corresponding to the eigenvalues
BX=bX with "b" the diagonal matrix corresponding to the eigenvalues
I took a look in a similar post topic https://stackoverflow.com/questions/56584609/finding-the-common-eigenvectors-of-two-matrices but had not managed to conclude, i.e having valid results when I build the final wanted endomorphism F defined by : F = P D P^-1
I have also read the wikipedia topic on Wikipedia and this interesting paper https://core.ac.uk/download/pdf/82814554.pdf but couldn't have to extract methods pretty easy to implement.
Particularly, I am interested by the
eig(A,B)
Matlab function.
I tried to use it like this :
% Search for common build eigen vectors between FISH_sp and FISH_xc
[V,D] = eig(FISH_sp,FISH_xc);
% Diagonalize the matrix (B^-1 A) to compute Lambda since we have AX=Lambda B X
[eigenv, eigen_final] = eig(inv(FISH_xc)*FISH_sp);
% Compute the final endomorphism : F = P D P^-1
FISH_final = V*eye(7).*eigen_final*inv(V)
But the matrix `FISH_final` don't give good results since I can do other computations from this matrix FISH_final (this is actually a Fisher matrix) and the results of these computations are not valid.
So surely, I must have done an error in my code snippet above.
If someone could help me to build these common eigenvectors and finding also the eigenvalues associated, this would be fine to tell it, I am a little lost between all the potential methods that exist to carry it out.
2 件のコメント
David Goodmanson
2021 年 1 月 4 日
Hi petit,
It appears that A and B known matrices and are you are looking for one or more X that are an eigenvector for both A and B. Be aware that
AX=aX BX=bX
is not at all the same as the eig(A,B) problem (shown here for a single eigenvalue lambda)
A*X = B*X*lambda
In the second case, for nonsingular B the problem reduces to the standard eigenvalue problem
(inv(B)*A)*X = X*lambda
with one set of eigenvalues, not two.
採用された回答
その他の回答 (2 件)
Bruno Luong
2021 年 1 月 4 日
編集済み: Bruno Luong
2021 年 1 月 4 日
K = null(A-B);
[W,D] = eig(K'*A*K);
X = K*W, % common eigen vectors
lambda = diag(D), % common vector
13 件のコメント
petit
2021 年 1 月 4 日
Bruno Luong
2021 年 1 月 4 日
Then there is NO common eigen-value/vector.
petit
2021 年 1 月 4 日
Bruno Luong
2021 年 1 月 4 日
編集済み: Bruno Luong
2021 年 1 月 4 日
I give you an example of what I understand, if I generate two (n x n) matrices having m common eigen vectors/eigan values
n=5;
m=2;
p=n-m;
cD=rand(1,m);
cV=rand(n,m);
AD=[cD rand(1,p)];
AV=[cV rand(n,p)];
BD=[cD rand(1,p)];
BV=[cV rand(n,p)];
A=(AV*diag(AD))/AV
B=(BV*diag(BD))/BV
Then if you apply my method it'll find those two common eigen vectors/values.
K = null(A-B);
[W,D] = eig(K'*A*K);
X = K*W, % common eigen vectors
lambda = diag(D), % common vector
Meaning for those three quantities are equal (in one specfic example)
> A*X
ans =
0.0117 0.0444
0.0264 0.0585
0.0562 0.0463
0.0543 0.0730
0.0041 0.0698
>> B*X
ans =
0.0117 0.0444
0.0264 0.0585
0.0562 0.0463
0.0543 0.0730
0.0041 0.0698
>> X*D
ans =
0.0117 0.0444
0.0264 0.0585
0.0562 0.0463
0.0543 0.0730
0.0041 0.0698
petit
2021 年 1 月 4 日
Bruno Luong
2021 年 1 月 4 日
編集済み: Bruno Luong
2021 年 1 月 4 日
I have no comment on what do you expect with your matrice data.
I simply reply what you ask for in your original question: finding X such that
AX = BX = X*D
with D diagonal.
I claim that my method give a full-rank basis solution of the above equation.
Bruno Luong
2021 年 1 月 4 日
編集済み: Bruno Luong
2021 年 1 月 4 日
Diagonal of D given by my solution are common eigen value of A and B.
Because you want
AX = BX
If X are eigen vectors then the above equality is
X*Da = X*Db
is true for some diagonal matrices Da and Db, there for Da==Db. I just call it D in my code.
And if
AX = BX
as YOU ask then
(A-B)*X = 0
Therefore
X belongs to NULL(A-B)
petit
2021 年 1 月 4 日
Bruno Luong
2021 年 1 月 4 日
編集済み: Bruno Luong
2021 年 1 月 4 日
I repeat myself:
"Then there is NO common eigen-value/vector."
petit
2021 年 1 月 4 日
Bruno Luong
2021 年 1 月 4 日
編集済み: Bruno Luong
2021 年 1 月 4 日
Quote: " I just want Common eigen vectors" meaning
AX = BX
This is equivalent to
(A-B)*X = 0
Therefore
X belongs to span of NULL(A-B)
If NULL returns empty result then there is NO common eigen vector.
This also implies eigen values are common, this is a consequence of YOUR request, not because I add it as an extra requirement. If you don't understand it you do not understand the math logic.
Might be you redefine the meaning of word "common"? If you do then right I don't understand what you want.
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!