Fitting exponential function, coefficients and errors
14 次查看(过去 30 天)
显示 更早的评论
Dear experts,
I have experimental data for exponential distribution a*exp(b*x). I need to find coefficients a, b and their errors. I have used function fit(B,C, 'exp1') and I got some results. I have problem because some data points in my file have higher error rate because of the nature of experiment.
1.) Which algorithm or function in Matlab can give the smallest error ? 2.) How can I use/adopt some function in Matlab to put smaller weight (when I calculate coefficients) on data that drastically differ from exponential function ?
Thank you.
0 个评论
采纳的回答
Jonathan LeSage
2013-11-6
You have quite a few options that you might want to check out to improve your exponential fit! As an option within the fit function, you can exclude outlier data points from the your exponential fit. For example, here is how you would find an exponential fit with the 25th and 30th data points removed (assuming these are outlier points):
[expFit,goodness] = fit(xdata,ydata,'exp1','Exclude', [25 30]);
You can also provide a vector of weights to augment your exponential fit. In the following example, the weight vector is used in the fit:
[expFit,goodness] = fit(xdata,ydata,'exp1','Weights',weightVec);
As you mentioned, you could decrease the influence of outliers by weighting them accordingly. Another recommendation would be to explore the curve fitting tool that allows you to graphically fit your data. Use cftool to open the user interface.
Here are some links to additional documentation to help get you started:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!