I have a matrix
P = randn(45875x65536 ); Pi = pinv (P);
I tried to run this code in matlab, but it takes long time
is it possible to split the matrix into smaller matrices then calculate the pseudo inverse?
any suggestion to reduce the time ?
Long story very short: No.
If that was possible, Matlab would likely be doing it already; in any case, the Matlab docs for
pinv say that the singular value decomposition method is used; that might not be the fastest method, but it's relatively stable for many cases of
P, so it's pretty much desirable unless you know exceptionally well what you're doing or your
P has special structure (in which case you'd probably not want to use the Moore-Penrose Pseudoinverse in the first place, maybe?).
Longer story: typically, you multiply your
Pi onto something to get the inverse operation to
To cite Matlab documentation itself:
You can replace most uses of pinv applied to a vector
b, as in
lsqminnorm(A,b)to get the minimum-norm least-squares solution of a system of linear equations.
lsqminnormis generally more efficient than
pinv, and it also supports sparse matrices.
But whether you can do that depends on the actual reason you're using the Moore-Penrose Pseudoinverse; not all uses are just replaceable with something else.
You could try using a QR decomposition.
matlab has a qrupdate routine that works with sparse matrices as well.