Multiple regression with multiple variations

1 visualización (últimos 30 días)
Tinphop C
Tinphop C el 16 de Feb. de 2019
Comentada: Matt J el 3 de Feb. de 2020
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 comentario
Matt J
Matt J el 3 de Feb. de 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

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 16 de Feb. de 2019
Editada: Matt J el 16 de Feb. de 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

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by