急!!跪求matlab高手 多元线性回归模型求解!高分!

2024-11-26 01:28:49
推荐回答(1个)
回答1:

>> Y1=[46.78 43.42 37.64]';
Y2=[36.05 37.43 31.63]';
Y3=[10.73 5.99 6.01]';
X1=[-6.08 -4.77 0.12]';
X2=[71.32 61.85 71.14]';
X3=[25.88 23.39 19.46]';
X4=[0.85 11.18 12.02]';
X5=[19.69 19.66 19.66]';
X6=[-0.71 -2.97 -0.17]';
X=[ones(3,1),X1,X2,X3,X4,X5,X6];
[B1,BINT1,R1,RINT,STATS1] = regress(Y1,X);
B1,BINT1,STATS1
[B2,BINT2,R2,RIN2,STATS2] = regress(Y2,X);
B2,BINT2,STATS2
[B3,BINT3,R3,RIN3,STATS3] = regress(Y3,X);
B3,BINT3,STATS3
Warning: X is rank deficient to within machine precision.
> In regress at 82

B1 =

0
0
0.0598
1.6387
0.1246
0
0

BINT1 =

0 0
0 0
NaN NaN
NaN NaN
NaN NaN
0 0
0 0

STATS1 =

1 NaN NaN NaN

Warning: X is rank deficient to within machine precision.
> In regress at 82

B2 =

0
0
-0.0382
1.4831
0.4561
0
0

BINT2 =

0 0
0 0
NaN NaN
NaN NaN
NaN NaN
0 0
0 0

STATS2 =

1 NaN NaN NaN

Warning: X is rank deficient to within machine precision.
> In regress at 82

B3 =

0
0
0.0979
0.1556
-0.3316
0
0

BINT3 =

0 0
0 0
NaN NaN
NaN NaN
NaN NaN
0 0
0 0

STATS3 =

1 NaN NaN NaN

>> rank(X)

ans =

3
说明X1-X6线性相关