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

Iain Day iain at day-online.org.uk.invalid
Mon Nov 6 12:45:01 EST 2006


Dear All,

I apologise in advance if this has been covered elsewhere, I can't seem 
to get my head around it.

I'm trying to globally fit a series of traces to the same function with 
some common and some local parameters. I have a 2D array (raw_signals) 
which contains each data trace as its columns. I have a 1D array of the 
time points.

I'd like to fit an exponential of the form:
	y(t) = A * exp(-t/B) + C

and I'd like C to be global across all data sets, but A and B to be 
local to each trace.

So far I've put A and B into arrays ntraces long. I'm trying to keep the 
code as general as possible as I've got lots to fit each with differing 
numbers of traces.

I've followed the example on the SciPy cookbook and I see the principle 
but I'm not sure ow to extend it in my case.

I've got some code which generates the error (cost) function as an array 
of the same dimensions as raw_signals, but I can't see how to use 
optimize.leastsq with that.

I hope this makes sense. I'll happily provide more info if needs be. Any 
help would be greatly appreciated.

Best wishes,

Iain




More information about the SciPy-User mailing list