I'm a little late, but maybe this will help someone else ...
I had a similar problem in julia .
I found this approach from the R help list , which should work in any environment using the lapack library:
Basically, if svd (M) is not working, try svd (M ') and replace the resulting U, V accordingly.
julia:
try
U,S,V = svd( E_restricted )
failed = false
catch
failed = true
end
if failed
# try it with matrix transposed
try
V,S,U = svd( E_restricted' )
failed = false
catch
failed = true
end
end
if failed
error("ERROR: svd(E) and svd(E') failed!")
end