SVD

12132013, 08:17 PM
Post: #1




SVD
I can't seem to get SVD to work for nonsquare matrices. This works perfectly on the 50g but fails on the Prime...unless I'm doing something wrong. Anyone else seen this?


12132013, 08:40 PM
Post: #2




RE: SVD
On the latest firmware:
\[ SVD\left ( \begin{bmatrix} 1 & 1 \\ 1 & 1 \\ \sqrt{3} & 0 \end{bmatrix} \right ) \] Gives "Error: Bad Argument Type" in both Home and CAS. Looks like a definite bug to me. Mark Hardman Ceci n'est pas une signature. 

12132013, 09:16 PM
Post: #3




RE: SVD
If it is a bug, it is a minor bug.
Try entering the SVD command in lowercase: \[ \textrm{simplify} \left ( \textrm{svd}\left ( \begin{bmatrix} 1 & 1 \\ 1 & 1 \\ \sqrt{3} & 0 \end{bmatrix} \right ) \right ) \] Gives a result of: \[ \begin{bmatrix} 0.5477 & 0.7071 & 0.4472 \\ 0.5477 & 0.7071 & 0.4472 \\ 0.6325 & 5.1840 \times 10^{17} & 0.7746 \end{bmatrix} \] Mark Hardman Ceci n'est pas une signature. 

12132013, 09:34 PM
(This post was last modified: 12132013 09:37 PM by jgreenb2.)
Post: #4




RE: SVD
Mark,
Thanks. How did you think to do this? The toolbox menu inserts in uppercase and the manual defines SVD in uppercase. Did you just try at random or is there some logic to when this matters? Also, using SVD() (uppercase) on a square matrix seems to work...very odd! 

12132013, 09:44 PM
Post: #5




RE: SVD
Search the old forum archives. The difference between UPPERCASE/lowercase for commands on the Prime has already generated several other bug reports. It is a matter of confusion that the Prime Team will hopefully address in a future release.
Mark Hardman Ceci n'est pas une signature. 

12132013, 10:03 PM
Post: #6




RE: SVD
Thanks, I'll check it out. I admit I want to like this calculator but it's been a bit of a trial so far!


12152013, 10:04 AM
Post: #7




RE: SVD
The current algorithm covered only square real matrices (as you can guess, implementing numeric algorithms is not my main business, and giac/xcas uses LAPACK for svd, therefore it was only required here), svd was also sometimes able to return an answer for rectangular matrices. I'm improving it, it will handle rectangular real or complex matrices that are well conditionned (0 or small singular values will not be handled, I'm not writing a dedicated numerical algorithm for that, just reusing existing routines).


12152013, 03:42 PM
(This post was last modified: 12152013 03:46 PM by jgreenb2.)
Post: #8




RE: SVD
Parisse,
Thanks for the clarification. Nice to know these things are being worked out. As long as there's a reasonable error message for illconditioned matrices I'll be happy It would also be nice if it worked correctly in RPN: svd() should take a matrix from the stack and just push U, S, V back onto the stack. jeff 

12162013, 09:22 AM
Post: #9




RE: SVD
Actually, you don't really need a message for illconditionned matrix, just look at the ratio between the largest singular value and the smallest one in s.


« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)