Borrar filtros
Borrar filtros

Use the return value of of the function lscov for weighted least squares?

1 visualización (últimos 30 días)
Ronan
Ronan el 9 de Dic. de 2015
Editada: Marek Svoboda el 10 de Feb. de 2020
After looking at the matlab example using the function lscov for the weighted least squares type, I was trying to use the return values b,se_b and mse? Is it possible to plot this on current figure? My assumption is that the weighted least square should be a best fit line through the data x1,y and x2,y. My ultimate goal is to find the error terms when modeling heteroscedastic data.
x1 = [.2 .5 .6 .8 1.0 1.1]';
x2 = [.1 .3 .4 .9 1.1 1.4]';
X = [ones(size(x1)) x1 x2]
y = [.17 .26 .28 .23 .27 .34]';
w = [1 1 1 1 1 .1]';
[b,se_b,mse] = lscov(X,y,w);
plot(x1,y,'b', x2,y,'r');

Respuestas (1)

Marek Svoboda
Marek Svoboda el 10 de Feb. de 2020
Editada: Marek Svoboda el 10 de Feb. de 2020

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by