필터 지우기
필터 지우기

How to determine start and end points of fitting curve?

조회 수: 2 (최근 30일)
Fotis
Fotis 2015년 12월 1일
편집: dpb 2015년 12월 1일
Hi all, I have
x=[0.25 0.50 0.75 1]
y=[0.0001 0.1 0.6889 10]
and I use power(2) to get the fitting curve. Is there a way to determine some points in the fitting curve? Because, when I get my fitting curve equation and use the above data, I get for x=0.25,y = 0.048 which is quite far from 0.00001. Any idea anyone how can I fix this?

답변 (1개)

dpb
dpb 2015년 12월 1일
편집: dpb 2015년 12월 1일
A power model doesn't fit these data worth a hooey at the lower end...try
plot(f,x,y,'*')
set(gca,'yscale','log')
ylim([y(1)/2 y(end)*2])
to see the problem; the curvature is positive for the fitted curve but negative in that region for the actual data. It appears either a 'power1' or linear in both log(x) log(y) would be a better fit of these data than 'power2'.
Addendum
b=polyfit(log(x),log(y),1); % fit log-log
yh=exp(polyval(b,log([x(1) x(end)]))); % Evaluate at end points
hold on
plot([x(1) x(end)],yh,'c') % add to the previous plot
You'll see this is quite a lot closer...but looking at residual errors one finds that the power1 model may be best overall...will leave that as "exercise for the student" :)
  댓글 수: 1
dpb
dpb 2015년 12월 1일
Oh, which illustrate why one should never curvefit w/o first plotting the data to see what gives...

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by