# eigenvectors and spectral decomposition

Home 2015 Forums Numerical Method Linear Algebra eigenvectors and spectral decomposition

This topic contains 6 replies, has 3 voices, and was last updated by  Haksun Li 6 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
• Author
Posts
• #1837

osigrtoelt
Participant

How do we do spectral decomposition (eigendecomposition) of a Hermitian matrix? I wasn’t able to get the orthonormal basis of eigenvectors if the characteristic equation has multiple roots. Thanks.

In R, we can do something like this:

> x < - diag(rep(1, 4))
> eigen(x)

\$values
[1] 1 1 1 1

\$vectors
[,1] [,2] [,3] [,4]
[1,]    0    0    0    1
[2,]    0    0    1    0
[3,]    0    1    0    0
[4,]    1    0    0    0

#1978

Haksun Li
Moderator

[tt:q1tj2dox]basis[/tt:q1tj2dox] has all the 4 vectors you are looking for.

#1979

osigrtoelt
Participant

Thanks for the answer, Haksun. However, I still don’t see how this should be done for a more general matrix with eigenvalues of multiplicity > 1.

Can we please implement the eigenvalue decomposition as a class like Cholesky or SVD? For a symmetric matrix A, we should have A = QDQ^{-1} = QDQ^T, where D is a diagonal matrix that contains all eigenvalues of A (counting multiplicity) and Q is an orthonormal matrix.

http://en.wikipedia.org/wiki/Eigenvalue_decomposition

#1980

Haksun Li
Moderator

It is already there.

This example has only one eigenvalue with multiplicity of 4.

The dimension of the space spanned by its basis is therefore 4. So, there are 4 orthogonal basis vector. Any linear combination of these 4 vector is a eigenvector.

To get the D, you just form a diagonal matrix using the eigenvalues, e.g., by new DiagonalMatrix(e1, e2,…).
To get the Q, you just form a matrix using the (basis) eigen vector, e.g., using R.cbind(v1, v2, v3, v4, …)

We will output D and Q more explicitly in the next release.

#1981

Haksun Li
Moderator

We now have eigen decomposition, e.g.,

#1982

ilyash
Participant

I decided to give a hand and sent a post into social bookmarks. I hope the popularity will rise in.

#1983

Haksun Li
Moderator

Thank you, CamKrist. It is appreciated.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.