Help with SVDC procedure [message #82969] |
Mon, 28 January 2013 13:24 |
fd_luni
Messages: 66 Registered: January 2013
|
Member |
|
|
Hi
I am trying to solve a matrix system with SVD method. Ihave the following arrays: A( 100 rows by 4 columns), X (4 rows by 1 column) and B (100 rows by 1 column). The form of the system is Ax=B. I used the Linear Least Squares and get the form x= V invert(SV) transpose(U)B (based on SVD procedure in IDL). The problem is that the 4 values that I get for the array x are not what I expected. I used the same method, same commands but with simpler arrays and it works. Why this doesn't work for my arrays??
The commands that I have used are the followings:
> A= TRANSPOSE([[C],[C1],[-CAd],[-CA]]) (I have defined these variables before)
> SVDC, A,W,U,V
> SV = DBLARR(4, 4)
> FOR K = 0, 3 DO SV[K,K]=W[K]
> result = U ## SV ## TRANSPOSE(V)
> print, result
> SVinv=invert(SV)
> ;help, SVinv
> Utrans=TRANSPOSE(U)
> ;help, Utrans
> B=TRANSPOSE([C2])
> ;help, B
> X=V##SVinv##Utrans##B
> print, X
Any help would be sincerely appreciated.
Mar
|
|
|