Perform n linear regressions, simultaneously
as far as I know, there is no way to put this all at once in the optimized Fortran library, LAPACK, since each regression is it's own independent optimization problem.
note that the loop over 4 items is not taking any time relative to the regression itself, that you need to fully compute because each regression is an isolated linear algebra problem... so I don't think there is much time to save here...
I have y - a 100 row by 5 column Pandas DataFrame
I have x - a 100 row by 5 column Pandas DataFrame
For i=0,...,4 I want to regress y[:,i] against x[:,i].
I know how to do it using a loop.
But is there a way to vectorise the linear regression, so that I don't have the loop in there?