[SciPy-user] memory error at leastsq

Robin robince@gmail....
Sat Jun 14 06:12:57 CDT 2008

On Sat, Jun 14, 2008 at 10:26 AM, Jose Lopez <lopmart@gmail.com> wrote:
> hi, help with memory error at leastsq
> I am working with a model mathematic of mean squeared error, according to
> the least square appproach, a solution is   sought by minimizing
>           MSE(I,B) = (S1-(I*B))^2+ (S2-(I*B))^2 + (S3-(I*B))^2
> where S1,S2,S3,I and B are matrix of k x l

I don't know if it could be related to your error, but you should be
careful whether you are using arrays or matrices. I think with
matrices the ^2 above will do matrix product, whereas for mean square
error you probably want this operation element-wise... So perhaps try
using arrays instead of matrices? You would probably want to take the
sum as well. It might be faster to use dot as well to do the squaring



More information about the SciPy-user mailing list