How do I improve my multiple regression model?

5 vues (au cours des 30 derniers jours)
Shivani Kohli
Shivani Kohli le 29 Nov 2017
Commenté : KSSV le 29 Nov 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 commentaire
KSSV
KSSV le 29 Nov 2017
Did you try polyfit and curve fitting toolbox?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by