Multiple regression with multiple variations

1 view (last 30 days)
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 Comment
Matt J
Matt J on 3 Feb 2020
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

Sign in to comment.

Accepted Answer

Matt J
Matt J on 16 Feb 2019
Edited: Matt J on 16 Feb 2019
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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!