Hello,
I want to implement matrix approximation using SVD.
The SVD algorithm returns three boxed matrices of the shapes x x ; x y ; y y
I want to chop and multiply back:
Step 1: reshape as - x M; M M ; M y where M is a small value
Step 2: Unbox and multiply (x M * M M * M y => x y)
My current implementation is:
s =. dgesvd ...
a =. M {. "1 (> 0 { s)
b =. M {. "1 (M {. (> 1 { s))
c =. M {. (> 2 { s)
mp =: +/ . *
approximated =. a mp b mp c
Now this is 1) ugly (for me) and 2) slow as hell.
Suggestions?
Thanks,
Yoel
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm