least squares method for the 3 unknowns

3 ビュー (過去 30 日間)
Marek Rousek
Marek Rousek 2015 年 12 月 21 日
編集済み: Renato Agurto 2015 年 12 月 21 日
Hi,
I have a problem how to calculate the 3 unknows using the least squares method.
I have a lot of same-looking equations like this: 46.2=C1*0.00134447+C2*0.006914+C3*0.01121469
where C1, C2 and C3 is unknow
How i can these unknow calculate with using the least squares method?
Here is code for example more equations
DMOS1=[46.2, 45.1, 47.3];
SSIM1=[0.00134447, 0.00114451, 0.00102085];
SSIM2=[0.006914, 0.006894, 0.007149];
SSIM3=[0.01121469, 0.01316054, 0.01604895];
A=[SSIM1; SSIM2; SSIM3];
A=A';
b=b';

回答 (2 件)

Renato Agurto
Renato Agurto 2015 年 12 月 21 日
Hello.
If
b = DMOS1'
then your solution is
A\b
  2 件のコメント
Marek Rousek
Marek Rousek 2015 年 12 月 21 日
when i tried for 1 equation:
DMOS1=[46.2, 45.1, 47.3];
SSIM1=[0.00134447, 0.00114451, 0.00102085];
SSIM2=[0.006914, 0.006894, 0.007149];
SSIM3=[0.01121469, 0.01316054, 0.01604895];
A=[SSIM1; SSIM2; SSIM3];
A=A';
b=DMOS1;
x=A/b;
C=x(1)*SSIM1(1)+x(2)*SSIM2(1)+x(3)*SSIM3(1);
result is 0,000003..., what is not 46,2!!!
Renato Agurto
Renato Agurto 2015 年 12 月 21 日
編集済み: Renato Agurto 2015 年 12 月 21 日
b = DMOS1'; %transposed
x=A\b; %not A/b!!

サインインしてコメントする。


Marek Rousek
Marek Rousek 2015 年 12 月 21 日
編集済み: Marek Rousek 2015 年 12 月 21 日
But these equations dont have a simple solution , I need to use the least squares method to find the most accurate solution , ideally also appear on the chart.
  1 件のコメント
Renato Agurto
Renato Agurto 2015 年 12 月 21 日
編集済み: Renato Agurto 2015 年 12 月 21 日
A\b is least squares. you can try it with a larger number of equations

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by