Re: [Tutor] leastsquares.py

2004-12-30 Thread Alan Gauld
> > def _leastSquare(): > > # do the thing that might generate negatives > > > > def leastSquare(): > > firstTry = _leastSquare() > > if firstTry < 0: > > return leastSquare() # try again > > else: > > return firstTry > > > > Primitive but it works. If you want more a e

RE: [Tutor] leastsquares.py

2004-12-30 Thread mdcooper
Hi Pierre, you are correct - the methods that simply refuse negative results will not be sufficient. The code I have so far is attached as *.py files. Thanks, Matt Be aware that I have adusted _lsq2.py so that it can be shown to the world - it still contains a basic outline of what should be d

Re: [Tutor] leastsquares.py

2004-12-30 Thread Pierre Barbier de Reuille
Alan Gauld a écrit : I am trying to use a least squares method (the one written by Konrad Hinsen), but I do not want the method to be able to generate negative values. Is there a way to stop least squares programs from doing so? def _leastSquare(): # do the thing that might generate negatives

Re: [Tutor] leastsquares.py

2004-12-29 Thread Alan Gauld
> I am trying to use a least squares method (the one written by Konrad Hinsen), > but I do not want the method to be able to generate negative values. Is there > a way to stop least squares programs from doing so? def _leastSquare(): # do the thing that might generate negatives def leastSquar

Re: [Tutor] leastsquares.py

2004-12-29 Thread Jason Child
mdcooper wrote: Hello all, I am trying to use a least squares method (the one written by Konrad Hinsen), but I do not want the method to be able to generate negative values. Is there a way to stop least squares programs from doing so? I have probably not included enough information but I am not