How do I improve my multiple regression model?

5 visualizaciones (últimos 30 días)
Shivani Kohli
Shivani Kohli el 29 de Nov. de 2017
Comentada: KSSV el 29 de Nov. de 2017
I am attaching my code, if you look at my coefficents they are huge and even my max error. How can I improve my results?
T = readtable('a.csv');
x1 = T.T;
x2 = T.Hour;
x3 = T.is_holiday;
x4 = T.month;
y = T.load;
A model of this data looks like :
Multiple regressions solves for coefficents by using a least squares fit.
Following line forms a matrix , X which has the first row set as 1, as it is necessary to do so in stats to have a constant term.
X = [ones(size(x1)) x1 x2 x3];
Solve for the different coefficents.
a = X\y
2.7423e+03\\ 0.8635 \\ 42.1795 \\ -87.1325 \\
The least- square fit model of the data is y = 27380+0.9x_1+42.2x_2-87.1x_3
Y = X*a;
MaxErr = max(abs(Y-y))
  1 comentario
KSSV
KSSV el 29 de Nov. de 2017
Did you try polyfit and curve fitting toolbox?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by