evaluate the error between the fitted curve and the data (NEW in fitting curve and optimization tools)
2 ビュー (過去 30 日間)
古いコメントを表示
hello everyone!
as I mentionned, I'm new in using fitting curve and optimization tools in matlab. I have data [theta,radius], and I want to fit them to a model.
firstly, I have plotted the deviation between my nominal radius and the radius from the data (please see the plot in colors).
Then, I applied the following code for fitting my curve to a model I established, in which a and b are unknown parameters (to find the values after).
function sse = sseval1(x,theta,radius)
a = x(1);
b = x(2);
sse = sum((radius - a*(b+10).*sqrt((1-sqrt((cos(2.*theta)).^2))./((cos(theta)).^2.*(sin(theta)).^2))).^2);
in the command window I write
fun = @(x)sseval1(x,theta,radius);
x0 = rand(4,1);
bestx = fminsearch(fun,x0)
a = bestx(1);
b = bestx(2);
yfit = a*(b+10).*sqrt((1-sqrt((cos(2.*theta)).^2))./((cos(theta)).^2.*(sin(theta)).^2));
figure; plot(theta,radius,'*');
hold on
plot(theta,yfit,'r');
The problem is the plot I get: the data are far from the fitted curve (which it seems to be not normal). what I should do then?
(I have tried the fminsearch, fmincon, and fminunc functions, but they give me the same result).
if I should provide more details, I will do surely.
Another question, is how to evaluate the error of the fitting model?
hope to get your help

2 件のコメント
Matt J
2019 年 3 月 15 日
編集済み: Matt J
2019 年 3 月 15 日
From your posting history, I see that you have left several answers to your questions un-accepted, even though your comments there indicate that those answers addressed your questions. To improve responsive to your posts, it is advisable to accept-click the answers which worked for you.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!