[Numpy-discussion] Efficient orthogonalisation with scipy/numpy

josef.pktd@gmai... josef.pktd@gmai...
Tue Jan 19 15:19:19 CST 2010


On Tue, Jan 19, 2010 at 4:11 PM, Gael Varoquaux
<gael.varoquaux@normalesup.org> wrote:
>> you can  combine x, and y for one call to leastsq, if it makes a difference
>> linalg.lstsq(confounds.T, [x,y])  #format? columnstack?
>
> Indeed! Thank you Joseph. That's a gain of 10% in the total computation
> time of my algorithm (and 20% on the partial correlation calculation).

if you have z=[x,y] stacked, just one call to dot might also help for
the correlation

zz = dot(z.T, z)
zz/sqrt(zz[0,0]*zz[1,1])

You might be able to do everything in a stacked version/

there is no ph in Josef (unless you talk about my french father-in-law)

Josef




>
> Gaël
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the NumPy-Discussion mailing list