Singular Value Decomposition (@svd)

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Omar
Posts: 4
Joined: Sat May 11, 2013 4:08 am

Singular Value Decomposition (@svd)

Postby Omar » Fri Jun 14, 2013 2:28 am

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.

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Singular Value Decomposition (@svd)

Postby trubador » Fri Jun 14, 2013 3:12 am

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)

Omar
Posts: 4
Joined: Sat May 11, 2013 4:08 am

Re: Singular Value Decomposition (@svd)

Postby Omar » Fri Jun 14, 2013 5:56 am

Thank you very much! It was very helpful.

ein.taype
Posts: 5
Joined: Fri May 05, 2017 9:56 am

Re: Singular Value Decomposition (@svd)

Postby ein.taype » Fri May 05, 2017 10:17 am

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?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests