필터 지우기
필터 지우기

Polyfit in case of power function

조회 수: 6 (최근 30일)
Ede gerlderlands
Ede gerlderlands 2013년 7월 29일
Hi All. I have an equation of the form y=b+ a.x^(1/3)
I tried to fit a line by assuming
m=x^(1/3);
p=polyfit(m,y,1);
f=polyval(p,m);
plot(x,y,'o',x,f,'-');
but the plot isn't satisfactory. Is there any wrong with the code or is the problem with my selection of fitting equation?
Regards,
  댓글 수: 7
Ede gerlderlands
Ede gerlderlands 2013년 7월 29일
Thank you very much
dpb
dpb 2013년 7월 29일
To get a grasp on what's going on, try the following...
plot(x,y)
b=polyfit(xp(6:end),y(6:end),1);
hold on, plot(x(6:end),polyval(b,xp(6:end)),'ro')
b=polyfit(xp(1:5),y(1:5),1);
plot(x(1:5),polyval(b,xp(1:5)),'go')
This separates the two sections of positive and negative curvature and fits the two regions separately.
As this clearly shows, x^1/3 is both too "weak" a correlation early on and of the opposite curvature later. There's simply no way you can adequately model these data w/ a single functional form of the type of a power relationship--they just don't follow that as a model.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by