[Numpy-discussion] Efficient orthogonalisation with scipy/numpy
Tue Jan 19 14:12:53 CST 2010
Forgive me for turning to the mailing list to do my homework. I am
currently optimizing a code, and it turns out that the main bottleneck is
the orthogonalisation of a vector 'y' to a set of vectors 'confounds',
that I am currently doing with the following code:
y = y - np.dot(confounds.T, linalg.lstsq(confounds.T, y))
with np = numpy and linalg = scipy.linalg where scipy calls ATLAS.
Most of the time is spent in linalg.lstsq. The length of the vectors is
810, and there are about 10 confounds.
Is there a better way of doing this?
More information about the NumPy-Discussion