What is the best optimization toolbox function to fit impulse response data?

Hello,
My initial model consisted of a system of two differential equations (characterized by an impulse input and an impulse response) with two unknown parameters. I solved the model equations quite well using an initial guess for the two unknown parameters but the fminsearch based optimization script rather eliminated all the peaks and failed to reproduce the impulse response nature of the experimental data. The figure below shows the 3 plots after the optimization process;
I would like to know which alternative functions in the optimization toolbox could best reproduce the impulse response nature of the measured data while finding the best parameter values.
Thanks

 采纳的回答

It is often true that the problem lies not in the tool that you use, but in how you use the tool.
If you use fminsearch as an optimizer with a poor choice of model for the problem at hand, then don't be surprised if a poor result comes out. If you use it with a poor choice of starting values, then don't be surprised if an optimizer fails to give you results that you like. These last two lines would have applied to ANY optimizer, not just fminsearch. A tool from the optimization toolbox will be just as problematic when used with the wrong model or with poor starting values. It is just that those tools will still give you an answer that you will be unhappy with, but more quickly.
You don't tell us any specifics of your model. I assume that you are forming a sum of squares of the residuals for your curve, based on a model. If not then perhaps that is why fminsearch fared poorly.
Regardless, fminsearch is a general optimizer. So you could have used either of fminunc or fmincon directly in its place.
Since you appear to be doing some sort of curve fit, you could also have used tools like lsqnonlin or lsqcurvefit. There you would not have needed to minimize a sum of squares of residuals, since they already do some of the work for you.

2 个评论

Thank you John D'Errico for the prompt reply.
I actually didn't want to bother readers with the model equations. The model equations I used are undeniably the best for the system I have but like you mentioned, the problem surely resides in the optimization approach with fminsearch.
Indeed I used the sum of squares in my objective function to be able to apply fminsearch , but I would have rather try the curve fit algorithm in-built in lsqnonlin.
Regards
Thank you once more John. I used the lsqnonlin function with better starting values for my parameters as you recommended though I also had to change a couple of things in my objective function. The results were much better.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by