How do I improve my multiple regression model?

5 Ansichten (letzte 30 Tage)
Shivani Kohli
Shivani Kohli am 29 Nov. 2017
Kommentiert: KSSV am 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))

Antworten (0)

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by