Global Error for a Fitting Function

조회 수: 15 (최근 30일)
Ella Kaplan
Ella Kaplan 2017년 3월 2일
댓글: Torsten 2017년 3월 2일
I'm trying to find the global error between a data set and a fitting function. My fitting function is a pretty good fit but the error I'm getting using my script is really large. Any advice?
plot(xC,yC,'.');
hold on;
x=linspace(0,8,400);
m=2;
linfit(xC,yC,m);
y=11.7601.*x.^2-35.7861.*x+120.6944;
plot(x,y)
E=zeros(length(x),1);
for ii=1:400
E(ii)=(yC(ii)-y(ii)).^2;
end
err=sum(E);
disp(err)
  댓글 수: 1
Torsten
Torsten 2017년 3월 2일
The usual indicator whether your fit is good or bad is the coefficient of determination:
https://en.wikipedia.org/wiki/Coefficient_of_determination
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by