The problem of constants in linear least squares

조회 수: 2 (최근 30일)
Jiapeng
Jiapeng 2022년 11월 10일
댓글: Walter Roberson 2022년 11월 10일
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];

채택된 답변

Star Strider
Star Strider 2022년 11월 10일
편집: Walter Roberson 2022년 11월 10일
since it is a constant, e becomes a vector of ones
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)
a = -2.876811 b = 0.223246 c = 0.538057 d = 3.276223 e = -0.435324
.
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 11월 10일
("becomes a vector of ones" for the purpose of doing fitting using the Vandermode-type matrix and the \ operator)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Thermal Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by