How do I improve my multiple regression model?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
Réponses (0)
Voir également
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!