[SciPy-user] optimization question

Matthieu Brucher matthieu.brucher@gmail....
Wed Jul 4 00:51:21 CDT 2007


>
> 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, ...?).



Yes, you can define a cost function and use it fmin, ... or the generic
optimizers (although such helper functions will be made in the near future)


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)).


Then it's a vector of parameters you have to fit ? Create your own cost
function, it's probably the easiest.

Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070704/f97ab0c5/attachment-0001.html 


More information about the SciPy-user mailing list