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!