필터 지우기
필터 지우기

weighted fit to log-log data

조회 수: 3 (최근 30일)
Ben
Ben 2014년 1월 13일
댓글: Ben 2014년 1월 15일
Hi, I need to perform a first order log-log fit with the ability to weight the samples. This should fit a straight line through data plotted on log-log paper. My code seems right to me but the results are wrong. Can any one set me straight?
x = independand data
y = dependant data
w = weighting scheme
d = lscov( [ones(size(x')) log10(x)'] ,log10(y)',w)
%if i plot this the fit line is out by a factor of ~10^3
loglog(10.^x,10.^y,'o',10.^[.2,.5],10^(d(1)).*10.^([.2,.5]*d(2)),'-')
  댓글 수: 1
Ben
Ben 2014년 1월 15일
Further to this, it seems to me that lscov is correct but my plotting is incorrect. This seems closer, but still incorrect:
loglog(x,y,'o',[.2,.5],10^(d(1))*10.^(d(2)*[.2,.5]),'-')
Any ideas where I'm going wrong?

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by