Fitting exponential function, coefficients and errors
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Omnis
le 2 Nov 2013
Réponse apportée : Jonathan LeSage
le 6 Nov 2013
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 commentaires
Réponse acceptée
Jonathan LeSage
le 6 Nov 2013
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interpolation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!