[Numpy-discussion] Multiple Regression

David Warde-Farley dwf at cs.toronto.edu
Thu Nov 12 19:01:50 EST 2009


On 12-Nov-09, at 6:44 PM, Robert Kern wrote:

>> I am using it on large number of observations so it is common to have
>> "x" matrix of about 5000x20 and "y" vector of length 5000, and more.
>> I also have to run that multiple times for different "y" vectors and
>> same "x" matrix.
>
> Just make a matrix "y" such that each column vector is a different
> output vector (e.g. y.shape == (5000, number_of_different_y_vectors))

Hmm, I just noticed that numpy.linalg.solve's docstring is wrong.

     Parameters
     ----------
     a : array_like, shape (M, M)
         Coefficient matrix.
     b : array_like, shape (M,)
         Ordinate or "dependent variable" values.

Whereas it *does* take multiple right-hand-side vectors, just like  
it's scipy.linalg counterpart (I found it somewhat odd that it  
wouldn't considering the LAPACK functions do).

So I guess that should read

     Parameters
     ----------
     a : array_like, shape (M, M)
         Coefficient matrix.
     b : array_like, shape (M,) or (M, N)
         Ordinate or "dependent variable" values.

I'll update it in the doc editor when I get home, if no one beats me  
to it.

David



More information about the NumPy-Discussion mailing list