Fitting experimental and theoretical values

13 views (last 30 days)
Hi all,
I have a question regarding fitting of a graph. I cannot divulge too much information as it is confidential. But, I would try my best to clearly explain my question.
I have theoretical values of a function as an array of 501 elements. Also, I have corresponding experimental values, not for the entire range, but for intermediate steps (e.g.: experimental values for 1, 45, 100,....501). I have to fit both these arrays using another function X. The function X has 25 values. Each of these values can be adjusted to get the best fit of theoretical and experimental data. The adjustment can be from 0 to 1.00 in steps of 0.01. Changing each value will have a subsequent independent effect on the fit. I need to find the best 25 values of function X that could lead to the best fit of theoretical and experimental data.
I have searched online to get some information but I am still at the starting point and I am not sure about the way to approach this question.
Thanks a lot, Cheers, Srikanth.

Accepted Answer

Star Strider
Star Strider on 17 Mar 2015
What you want to do is termed ‘parameter estimation’. There are several MATLAB functions in various toolboxes that will do that, for example the Optimization Toolbox function lsqcurvefit, Statistics Toolbox nlinfit, and the Curve Fitting Toolbox.
That you want to estimate 25 parameters, even with 501 data pairs, may be difficult. The most important aspect to consider is that the ‘best’ solution is highly dependent on your choice of initial parameter estimates (starting values). I would do exploratory analyses with much simpler functions (with much fewer parameters) to get an idea of the parameter range that will likely be most successful. The problem with a large parameter set is that you are likely to encounter many local minima (false solutions) before you find the global minimum (best solution). The best solution is the solution with the lowest residual error.
Depending on the form of your objective function (the function you want to fit to your data), a unique set of estimated parameters may not be possible.
This is a complex topic, and I suggest you do some research on ‘nonlinear parameter estimation’ before you begin your project. While you can simply give data and your objective function to the nonlinear parameter estimation routines in MATLAB, if you have no idea how they work and the theoretical basis of nonlinear parameter estimation, this could become a very frustrating experience for you.
  2 Comments
rafik
rafik on 18 Apr 2016
hi everybody, in my case i've done all the parameter estimation process get a nice GOF,estimated parameters all falled in their natural CI, but the residuals graphics shows a non linear trend even if the GOF was good. Could you plase give me a tip to fix that ? thanks
Star Strider
Star Strider on 18 Apr 2016
My guess is that your model does not account for all the dynamics of your data. The only ‘fix’ I can suggest is to change your model to more accurately reflect the process that created your data.

Sign in to comment.

More Answers (1)

Sr VK
Sr VK on 24 Mar 2015
Hi Stra Strider,
Thank you for the detailed response. It is a good start. I will have a look at all the functions that you have listed.
Cheers,

Community Treasure Hunt

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

Start Hunting!