The problem of constants in linear least squares
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jiapeng
am 10 Nov. 2022
Kommentiert: Walter Roberson
am 10 Nov. 2022
The equation of the model is ay^2+bxy+cx+dy+e=x^2.
Since e is a constant not associated with any variable, how should we get the value of e?
x = [1.02; 0.95; 0.77; 0.67; 0.56; 0.30; 0.16; 0.01];
y = [0.39; 0.32; 0.22; 0.18; 0.15; 0.12; 0.13; 0.15];
0 Kommentare
Akzeptierte Antwort
Star Strider
am 10 Nov. 2022
Bearbeitet: Walter Roberson
am 10 Nov. 2022
x = [1.02; 0.95; 0.77; 0.67; 0.56; 0.30; 0.16; 0.01];
y = [0.39; 0.32; 0.22; 0.18; 0.15; 0.12; 0.13; 0.15];
B = [y.^2 x.*y x y ones(size(x))] \ x.^2;
fprintf('\na = %10.6f\nb = %10.6f\nc = %10.6f\nd = %10.6f\ne = %10.6f\n',B)
.
1 Kommentar
Walter Roberson
am 10 Nov. 2022
("becomes a vector of ones" for the purpose of doing fitting using the Vandermode-type matrix and the \ operator)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Operating on Diagonal Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!