Borrar filtros
Borrar filtros

weighted fit to log-log data

3 visualizaciones (últimos 30 días)
Ben
Ben el 13 de En. de 2014
Comentada: Ben el 15 de En. de 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 comentario
Ben
Ben el 15 de En. de 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?

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by