フィルターのクリア

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 Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by