Menu

#1207 determineSVD gives wrong dimensions in U for m<n

open-duplicate
5
2010-07-28
2010-07-28
Anye Li
No

Given an m-by-n matrix A, lassign "[::math::linearalgebra::determineSVD $A] U S V" will return an m-by-n matrix U. While this is often what you want for overdetermined systems (m>n), this is not what you want for underdetermined systems (m<n) and is not consistent with any definition of the SVD I know of. If (m<n), the S and V matrices should be truncated if truncation is desired.

Incidentally, sometimes I don't want the U matrix to be truncated when m>n, for example when I am as interested in the residuals than the actual fit.

Discussion

  • Anye Li

    Anye Li - 2010-07-28

    Sorry, I pressed the browser refresh button in the wrong window.

     
  • Anye Li

    Anye Li - 2010-07-28
    • status: open --> open-duplicate
     
  • Arjen Markus

    Arjen Markus - 2010-08-09

    (Back from my holidays) I will have a look at this and report back.

     
  • Arjen Markus

    Arjen Markus - 2010-08-12

    Could you provide me with a small example? That would help solving this issue

     
  • Anye Li

    Anye Li - 2010-08-12

    Example:

    package require math::linearalgebra
    # -> 1.1.3
    namespace import ::math::linearalgebra::*
    set A {{4 5 6} {7 8 9}}
    shape A
    # -> 2 3
    lassign [determineSVD $A] U S V
    shape $U
    # -> 2 3 (should be 2 2)
    shape $S
    # -> 3 (could be 2)
    shape $V
    # -> 3 3 (could be 2 3)