Effacer les filtres
Effacer les filtres

weighted fit to log-log data

3 vues (au cours des 30 derniers jours)
Ben
Ben le 13 Jan 2014
Commenté : Ben le 15 Jan 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 commentaire
Ben
Ben le 15 Jan 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?

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by