Single Value Decomposition
LYBeaulieu
08-05-2003, 07:02 AM
I've tried to adapted the Fortran 77 svpcmp() code to Visual Basic but It doesn't seem to work for large matrices. Does anybody have a working SVD code for Visual Basic?
Also, can anybody explain to me why the variable "its" in do loop 48 goes from 1 to 30. Why 30?!?! Does this affect the maximum size matrix this routine can handle.
Thanks
Luc
TMcCloskey
08-07-2003, 05:46 AM
LYBeaulieu - how LARGE is "large"? Can you provide example of dimension size? Test cases?
The variable "Its" is an iteration counter for the QR singular value iteration phase and should not necessarly limit the size of the matrix (except in the extreme case). Convergence within this phase is very rapid even for substantial systems. The maximum value of "Its" is arbitrarly set at 30 and, for most cases, this is sufficient for convergence.
You may want to consider monitoring the value of "Its" if you think this is a problem. I suspect it is not.
I do have a Visual Basic for Applications (Excel) version of this routine. Although its contained within VBA, the code is pure Visual Basic (ie, no worksheet.functions used). I'll retrieve this and post separately in a short while.
TMcCloskey
11-27-2003, 07:15 AM
Looks like I forgot to post the VBA code that I spoke of ... sorry ... so here it is (see attachment).
The file attached (SVD_VBA) is pure text and can be imported into VBA (it was currently exported from an Excel project).
Also included in the file is the back-solve routine and a few support routines to mimic some FORTRAN intrinsics like DSIGN etc.
[Arg! - wrong attachment uploaded -- please see new attachment next message].
TMcCloskey
11-27-2003, 07:30 AM
Correct attachment SVD-VBA