Page 1 of 1

SVD to non-symetric Matrix (@svd)

Posted: Fri May 05, 2017 10:08 am
by ein.taype
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.

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

Posted: Fri May 05, 2017 10:49 am
by EViews Matt
Hello,

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

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

Posted: Fri May 05, 2017 11:32 am
by ein.taype
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)

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

Posted: Fri May 05, 2017 12:12 pm
by EViews Matt
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.

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

Posted: Fri May 05, 2017 12:56 pm
by ein.taype
Thank you. Exactly, the full SVD like in the other software.

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

Posted: Fri May 05, 2017 1:26 pm
by EViews Matt
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.

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

Posted: Fri May 05, 2017 2:48 pm
by ein.taype
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.

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

Posted: Fri May 05, 2017 4:21 pm
by EViews Matt
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).

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

Posted: Wed May 10, 2017 10:19 am
by EViews Matt
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.