SVD to non-symetric Matrix (@svd)

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

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

SVD to non-symetric Matrix (@svd)

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

I just found that Eviews only allows it to symetric matrices, because of complex numbers. Anyone have a suggestion on how to do it in eviews. I don't really know if it's possible doing it manually. Need something like the "fullsvd" function of stata, though I don't use that software.

EViews Matt
EViews Developer
Posts: 583
Joined: Thu Apr 25, 2013 7:48 pm

Re: SVD to non-symetric Matrix (@svd)

Postby EViews Matt » Fri May 05, 2017 10:49 am

Hello,

EViews can perform the SVD of non-symmetric, non-square matrices. Do you have a matrix for which @svd fails?

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

Re: SVD to non-symetric Matrix (@svd)

Postby ein.taype » Fri May 05, 2017 11:32 am

yes I have a matrix "A" of 31 rows and 57 columns. i have the size mismatch message.

matrix V
vector sing_val
matrix U
matrix U=@svd(A,sing_val,V)


The type of descomposition I need is this one: A(mxn)= U(mxm)*S(mxn) *V(nxn), this is my main concern
and the SVD for non-symetric gives u this : A(mxn)= U(mxn)*S(nxn) *V(nxn)

EViews Matt
EViews Developer
Posts: 583
Joined: Thu Apr 25, 2013 7:48 pm

Re: SVD to non-symetric Matrix (@svd)

Postby EViews Matt » Fri May 05, 2017 12:12 pm

I'll look into the error. Know that EViews calculates the "economy" SVD which removes portions of the results that correspond to singular values of zero, where as what you want is the "full" SVD.

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

Re: SVD to non-symetric Matrix (@svd)

Postby ein.taype » Fri May 05, 2017 12:56 pm

Thank you. Exactly, the full SVD like in the other software.

EViews Matt
EViews Developer
Posts: 583
Joined: Thu Apr 25, 2013 7:48 pm

Re: SVD to non-symetric Matrix (@svd)

Postby EViews Matt » Fri May 05, 2017 1:26 pm

I'm afraid the full SVD isn't available in EViews 9 (EViews 10 includes it). However, you can do something close to the full SVD by extending your matrix to be square and filling in the extra rows with zeros. The resulting U matrix will have extra rows and columns, but the true U can easily be extracted. I think the only numeric difference would be in the rightmost columns of V, corresponding to the null-space basis of your original matrix. Depending on what you're using the SVD for, that difference may be acceptable.

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

Re: SVD to non-symetric Matrix (@svd)

Postby ein.taype » Fri May 05, 2017 2:48 pm

The SVD comand gives me more the "S" matrix(31x31) , which contains the eigenvalues. Then I add colums of ceros, so i have a new S (31x57). Then I also have the A matrix by default.


A(31x57)-U(31x31)*S(31x57)*V(57x57)= zero (31x57), I only have reliable data for A and S. And I will use one of the outputs of the @sdv as "U(31x31)".

I only need to calculate "V(57x57)", how can I solve the equation ? which code should I used. Noting that "U*S" can't be inverse because it's not square. I guess anytype of goalseek command or something.

Thank u a lot for your help.

PD: Eviews 10 is not available yet, but in 9.5 , u think I'll have more lucky? I use eviews 8.

EViews Matt
EViews Developer
Posts: 583
Joined: Thu Apr 25, 2013 7:48 pm

Re: SVD to non-symetric Matrix (@svd)

Postby EViews Matt » Fri May 05, 2017 4:21 pm

You're trying to take the SVD of matrix A(31x57), correct? My suggestion is to add rows of zeros to A until it is square (57x57).

EViews Matt
EViews Developer
Posts: 583
Joined: Thu Apr 25, 2013 7:48 pm

Re: SVD to non-symetric Matrix (@svd)

Postby EViews Matt » Wed May 10, 2017 10:19 am

In the next patch, @svd will be able to decompose matrices with fewer rows than columns, which was (to my knowledge) an undocumented limitation. The decomposition is still the "economic" or "compact" form, not the full SVD.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests