Page 1 of 1

Singular Value Decomposition (@svd)

Posted: Fri Jun 14, 2013 2:28 am
by Omar
Hi,

For a given (N x M) matrix A, the theorem on singular value decomposition states that:

A = U * S * V

where the columns of U are the eigenvectors of AA' and the columns of V are eigenvectors of A'A. And S is a diagonal matrix containing the square roots of non-negative eigenvalues from U in descending order.

In Eviews, the command @svd(A) returns the U matrix for A. I was wondering if there is a way to directly get the diagonal matrix S. Can anyone help?

Thanks.

Re: Singular Value Decomposition (@svd)

Posted: Fri Jun 14, 2013 3:12 am
by trubador

Code: Select all

'create a random matrix matrix A = @mnrnd(4,3) 'define the components matrix U vector S matrix V 'decompose the matrix A U = @svd(A,S,V) 'if you like S as a diagonal matrix matrix MS = @makediagonal(S)

Re: Singular Value Decomposition (@svd)

Posted: Fri Jun 14, 2013 5:56 am
by Omar
Thank you very much! It was very helpful.

Re: Singular Value Decomposition (@svd)

Posted: Fri May 05, 2017 10:17 am
by ein.taype
I get the "mistmatch message" when using @svd to a non-symetric matrix of 37x51. Are u sure, the formula can run for non-symetric matrices?