Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Name : Anuj Jagannath Said

Roll number : ME21B172

N=1000;
x1=2.4+.31*randn(N,1);
x2=5.2+.5*randn(N,1);
x3=3.6+.22*randn(N,1);
y=8*x1+4.3*x2+2.5*x3;
y_noise=awgn(y,10);
X=[x1,x2,x3];
mdl=fitlm(X,y_noise)

mdl =
Linear regression model:
y ~ 1 + x1 + x2 + x3

Estimated Coefficients:
Estimate SE tStat pValue
________ ________ _______ __________

(Intercept) 0.021937 0.20155 0.10884 0.91335


x1 8.0323 0.031934 251.53 0
x2 4.3137 0.018854 228.79 0
x3 2.4505 0.043921 55.793 9.222e-309

Number of observations: 1000, Error degrees of freedom: 996


Root Mean Squared Error: 0.307
R-squared: 0.992, Adjusted R-Squared: 0.992
F-statistic vs. constant model: 3.92e+04, p-value = 0

plot(mdl)

1
2

You might also like