[SciPy-user] Fitting with global parameters optimize.leastsq

Iain Day iain at day-online.org.uk.invalid
Wed Nov 8 14:04:52 CST 2006


Steve Schmerler wrote:

>>> 2) You're trying to fit all data sets (t == data_points, y == 
>>> raw_signals[:, i]) at once and I guess that won't work. You have to loop 
>>> over A (or C or raw_signals[:, i]) building one data set and one initial 
>>> guess (x0 = numpy.array([A[i], B, C[i]])) per loop.
>> That sounds similar to fitting each trace separately, and wouldn't give 
>> you the global B?
>>
> 
> Well, yes. Taking a closer look at the cookbook example I see that this 
> is indeed the right thing to do :)
> 
> Although, I'm curious as to how this works if you don't fit 2 data sets 
> but, say 100 with respect to local mimima in a such a high-dimensional 
> search space.

That's beyond my little brain I'm afraid, but the results I'm getting 
look good. I think you need pretty good initial guesses, but allowing 
several linked (i.e. global) parameters does reduce the number of 
degrees of freedom and hence the size of the search space.

Thanks again.

Iain




More information about the SciPy-user mailing list