[SciPy-user] optimization question

Volker Lorrmann lorrmann@physik.uni-wuerzburg...
Tue Jul 3 17:18:23 CDT 2007


Hello list,

i wanna fit a function to some measured datapoints T_m(x_i). The 
function i wanna fit  is something like that,T_fit(a,b,c,d,x_i), where 
a,b,c are the fitting-parameters. Fitting this with 
scipy.optimize.leastsq would be easy (btw. is there anoterh way to fit 
this, like fmin, fmin_powell, ...?).

The problem is, that a is a and b are _fixed_ scalar parameters. But c 
and d are variables, that depend on x_i, c=c(x_i) and d=d(x_i). And in 
fact, c(x_i) and d(x_i) are the variables i´m mainly interested in. (a 
and b are nearly exactly known, so i can reduce the fitting_function to 
T(c(x_i),d(x_i),x_i)).


I hope you can see what my problem is, its late here and i´m tired, so 
maybe i haven´t explained very well.


Maybe the following will help

           ---
           \                                          2
minimize    |  {T_meas(x_i) - T(a,b,c(x_i),d(x_i),x_i)}
           /
           ---
           i

is what i´m lookig for. Is this possible with scipy.optimize.leastsq, or 
should i use some other routine therefor? And if so, which on?

Thanks so far
    Volker



More information about the SciPy-user mailing list