Azzera filtri
Azzera filtri

weighted fit to log-log data

3 visualizzazioni (ultimi 30 giorni)
Ben
Ben il 13 Gen 2014
Commentato: Ben il 15 Gen 2014
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 Commento
Ben
Ben il 15 Gen 2014
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?

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by