1

I have to find a model that fits a experimental data. The issue is that the model is a complex function.

I have to minimize the error between the model and the experimental data, both for the real part and the imaginary part. I'm using fminsearch to find the parameters of the function which minimize the error. I have separated the real and imaginary part in order to use that function.

My problem is that I don´t know the function of error I have to use.

Up to now i have use

norm ((error_in_real_part)^2+(error_in_imaginary_part)^2)

but the obtained model does not satisfy the experimental data at all, at least for the imaginary part. I've changed the initial conditions several times and its impossible to improve the fit of the imaginary part. The magnitude of the imaginary part is several times less than the real one. That could be the reason?

  • Do you have the Optimization Toolbox? – siliconwafer Apr 16 '15 at 19:31
  • wild guess - the error in the imaginary part is an imaginary number, squaring it makes it a negative real number and minimizing this means you are actually driving the two as far away as possible? – alexandre iolov Apr 17 '15 at 08:04
  • 1
    The answer may depend on your data. Please explain your experiment. Can you show typical curves? Along with your fit attempt? – Joachim W Apr 17 '15 at 14:22
  • 2
    For complex models, the returned fit often depends strongly on the initial conditions. Try to change the `x0` input to `fminsearch` to see whether you can get a better fit. – A. Donda Apr 17 '15 at 14:33

0 Answers0