[SciPy-user] optimization question

Volker Lorrmann lorrmann@physik.uni-wuerzburg...
Wed Jul 4 02:20:16 CDT 2007

Hi Robert,

 > All leastsq() really adds to fmin*() is that you return the residuals 
 > instead of summing up the squares of the residuals. You can do that
 > manually and use whichever minimizer you need.

Can you give me a short example, how to do so? I´ve asked this also 
Matthieu, so if he will answer, you probably don´t need to. But two 
examples would be better than one ;)

 > Well, that's a big problem. You have twice as many variables to fit 
as > you have datapoints. There are possibly an infinite number of
 > solutions that exactly(!) fit your data.

I see, indeed i need as many datapoints (equations) as variables, to 
solve the problem.

 > Is it possible that you can reparameterize your problem? Perhaps c(.) 
 > and d(.)
 > could be formulated as functions that depend on some small number of 
  > parameters
 > besides x_i in order to smooth things out. You would then do
 > least-squares to optimize those parameters.

I think i can do that. There are some physical constraints for c(x_i) 
and d(x_i), which should make it possible to reparameterize c an d.


More information about the SciPy-user mailing list