Re: [Numpy-discussion] inversion of large matrices

2010-10-11 Thread Daniel Elliott
Sturla Molden molden.no> writes: > > Yes, this is what I am computing. I am computing the pdf of a very high- > > dimensional multivariate normal. Is there a specialized method to compute > > this? > > If you use cho_solve and cho_factor from scipy.linalg, you can proceed > like this: > > c

Re: [Numpy-discussion] inversion of large matrices

2010-09-09 Thread Pauli Virtanen
Thu, 09 Sep 2010 18:18:29 +0200, Sturla Molden wrote: [clip] > I hope the SciPy dev team can be persuaded to include a wrapper for > DTRTRS in the future. It is after all extremely useful for Mahalanobis > distances, and thus for any use of linear models in statistics. I don't see reasons why not

Re: [Numpy-discussion] inversion of large matrices

2010-09-09 Thread Sturla Molden
> Yes, this is what I am computing. I am computing the pdf of a very high- > dimensional multivariate normal. Is there a specialized method to compute > this? If you use cho_solve and cho_factor from scipy.linalg, you can proceed like this: cx = X - m sqmahal = (cx*cho_solve(cho_factor(S),

Re: [Numpy-discussion] inversion of large matrices

2010-09-08 Thread Daniel Elliott
Wow, this is great! Thanks for all the great questions. Sebastian Walter gmail.com> writes: > is it really the covariance matrix you want to invert? Or do you want > to compute something like > x^T C^{-1} x, > where x is an array of size N and C an array of size (N,N)? Yes, this is what I am c

Re: [Numpy-discussion] inversion of large matrices

2010-09-01 Thread Sebastian Walter
is it really the covariance matrix you want to invert? Or do you want to compute something like x^T C^{-1} x, where x is an array of size N and C an array of size (N,N)? It would also be interesting to know how the covariance matrix gets computed and what its condition number is, at least approxim

Re: [Numpy-discussion] inversion of large matrices

2010-08-31 Thread Charles R Harris
On Tue, Aug 31, 2010 at 4:52 PM, Dan Elliott wrote: > David Warde-Farley cs.toronto.edu> writes: > > On 2010-08-30, at 10:36 PM, Charles R Harris wrote: > > I think he means that if he needs both the determinant and to solve the > > system, it might be more efficient to do > > the SVD, obtain the

Re: [Numpy-discussion] inversion of large matrices

2010-08-31 Thread Dan Elliott
David Warde-Farley cs.toronto.edu> writes: > On 2010-08-30, at 10:36 PM, Charles R Harris wrote: > I think he means that if he needs both the determinant and to solve the > system, it might be more efficient to do > the SVD, obtain the determinant from the diagonal values, and obtain the > solutio

Re: [Numpy-discussion] inversion of large matrices

2010-08-31 Thread David Warde-Farley
On 2010-08-30, at 10:19 PM, Dan Elliott wrote: > You don't think this will choke on a large (e.g. 10K x 10K) covariance > matrix? That depends. Is it very close to being rank deficient?That would be my main concern. NumPy/LAPACK will have no trouble Cholesky-decomposing a matrix this big, pr

Re: [Numpy-discussion] inversion of large matrices

2010-08-31 Thread Anne Archibald
Hi Melissa, On 30 August 2010 17:42, Melissa Mendonça wrote: > I've been lurking for a while here but never really introduced myself. > I'm a mathematician in Brazil working with optimization and numerical > analysis and I'm looking into scipy/numpy basically because I want to > ditch matlab. W

Re: [Numpy-discussion] inversion of large matrices

2010-08-31 Thread David Warde-Farley
On 2010-08-30, at 10:36 PM, Charles R Harris wrote: > I don't see what the connection with the determinant is. The log determinant > will be calculated using the ordinary LU decomposition as that works for more > general matrices. I think he means that if he needs both the determinant and to so

Re: [Numpy-discussion] inversion of large matrices

2010-08-30 Thread Charles R Harris
On Mon, Aug 30, 2010 at 8:19 PM, Dan Elliott wrote: > Thanks for the reply. > > David Warde-Farley cs.toronto.edu> writes: > > On 2010-08-30, at 11:28 AM, Daniel Elliott wrote: > > > Large matrices (e.g. 10K x 10K) > > > > > Is there a function for performing the inverse or even the pdf of a > >

Re: [Numpy-discussion] inversion of large matrices

2010-08-30 Thread David
On 08/31/2010 11:19 AM, Dan Elliott wrote: > Thanks for the reply. > > David Warde-Farley cs.toronto.edu> writes: >> On 2010-08-30, at 11:28 AM, Daniel Elliott wrote: >>> Large matrices (e.g. 10K x 10K) >> >>> Is there a function for performing the inverse or even the pdf of a >>> multinomial nor

Re: [Numpy-discussion] inversion of large matrices

2010-08-30 Thread Dan Elliott
Thanks for the reply. David Warde-Farley cs.toronto.edu> writes: > On 2010-08-30, at 11:28 AM, Daniel Elliott wrote: > > Large matrices (e.g. 10K x 10K) > > > Is there a function for performing the inverse or even the pdf of a > > multinomial normal in these situations as well? > > There's a fu

Re: [Numpy-discussion] inversion of large matrices

2010-08-30 Thread Charles R Harris
On Mon, Aug 30, 2010 at 3:42 PM, Melissa Mendonça wrote: > Hi, > > I've been lurking for a while here but never really introduced myself. > I'm a mathematician in Brazil working with optimization and numerical > analysis and I'm looking into scipy/numpy basically because I want to > ditch matlab.

Re: [Numpy-discussion] inversion of large matrices

2010-08-30 Thread David Warde-Farley
On 2010-08-30, at 5:42 PM, Melissa Mendonça wrote: > I'm just curious as to why you say "scipy.linalg.solve(), NOT > numpy.linalg.solve()". Can you explain the reason for this? Oh, the performance will be similar, provided you've linked against a good BLAS. It's just that the NumPy version do

Re: [Numpy-discussion] inversion of large matrices

2010-08-30 Thread Melissa Mendonça
Hi, I've been lurking for a while here but never really introduced myself. I'm a mathematician in Brazil working with optimization and numerical analysis and I'm looking into scipy/numpy basically because I want to ditch matlab. I'm just curious as to why you say "scipy.linalg.solve(), NOT numpy.

Re: [Numpy-discussion] inversion of large matrices

2010-08-30 Thread David Warde-Farley
On 2010-08-30, at 11:28 AM, Daniel Elliott wrote: > Hello, > > I am new to Python (coming from R and Matlab/Octave). I was preparing > to write my usual compute pdf of a really high dimensional (e.g. 1 > dimensions) Gaussian code in Python but I noticed that numpy had a > function for compu

[Numpy-discussion] inversion of large matrices

2010-08-30 Thread Daniel Elliott
Hello, I am new to Python (coming from R and Matlab/Octave). I was preparing to write my usual compute pdf of a really high dimensional (e.g. 1 dimensions) Gaussian code in Python but I noticed that numpy had a function for computing the log determinant in these situations. Is there a functi