Multiple regression with multiple variations

1 回表示 (過去 30 日間)
Tinphop C
Tinphop C 2019 年 2 月 16 日
コメント済み: Matt J 2020 年 2 月 3 日
I have the example data as show in bellow,
x1 = [288 298 308 318 328 338 283 293 303 313 323 333 283 293 303 313 323 333];
x2 = [17.42 17.4217.42 17.42 17.42 17.42 17.95 17.95 17.95 17.95 17.95 17.95 17.13 17.13 17.13 17.13 17.13 17.13];
x3 = [1.2111 1.2111 1.2111 1.2111 1.2111 1.2111 1.2684 1.2684 1.2684 1.2684 1.2684 1.2684 0.6207 0.6207 0.6207 0.6207 0.6207 0.6207];
y = [6.785 6.777 6.770 6.762 6.754 6.746 6.793 6.785 6.777 6.768 6.760 6.751 6.786 6.777 6.769 6.760 6.752 6.743];
and, I have the equation for predicting as show in the following,
y = a + bx2 + cx3 + (d + e*x2 + f*x3) / x1) ....(1)
where, a, b, c, d, e, and f are the constant.
How to write the code in matlab for optimizing the constants of Eq. (1)?
  1 件のコメント
Matt J
Matt J 2020 年 2 月 3 日
Samir Albadri'c omment move here
Greeting All
If I have the data and I want to get the equation for the Multiple regression with MATLAB code is that possiable?
Thanks
Samir

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

採用された回答

Matt J
Matt J 2019 年 2 月 16 日
編集済み: Matt J 2019 年 2 月 16 日
e=ones(size(x1));
abcdef = y/[e;x2;x3;1./x1;x2./x1;x3./x1]
abcdef =
6.3301 0.0113 -0.0117 88.7676 -0.8784 3.9478

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by