多元回归 matlab这里有一组数据x1(7.5323 7.9262 8.2833 8.5420 8.7702)x2(117.2 117.4 117.7 118.3 118.6)x3(2.950 3.300 5.270 6.525 7.470)x4(2001 2002 2003 2004 2005)y(12.7627 12.8453 12.9277 12.9988 13.0756)用y=a*x1+b*x2+c
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 12:06:53
多元回归 matlab这里有一组数据x1(7.5323 7.9262 8.2833 8.5420 8.7702)x2(117.2 117.4 117.7 118.3 118.6)x3(2.950 3.300 5.270 6.525 7.470)x4(2001 2002 2003 2004 2005)y(12.7627 12.8453 12.9277 12.9988 13.0756)用y=a*x1+b*x2+c
多元回归 matlab
这里有一组数据x1(7.5323 7.9262 8.2833 8.5420 8.7702)
x2(117.2 117.4 117.7 118.3 118.6)
x3(2.950 3.300 5.270 6.525 7.470)
x4(2001 2002 2003 2004 2005)
y(12.7627 12.8453 12.9277 12.9988 13.0756)
用y=a*x1+b*x2+c*x3+d*x4+e来拟合求出abcde
分数不是问题
用matlat拟合哦
多元回归 matlab这里有一组数据x1(7.5323 7.9262 8.2833 8.5420 8.7702)x2(117.2 117.4 117.7 118.3 118.6)x3(2.950 3.300 5.270 6.525 7.470)x4(2001 2002 2003 2004 2005)y(12.7627 12.8453 12.9277 12.9988 13.0756)用y=a*x1+b*x2+c
x1=[7.5323 7.9262 8.2833 8.5420 8.7702]';
x2=[117.2 117.4 117.7 118.3 118.6]';
x3=[2.950 3.300 5.270 6.525 7.470]';
x4=[2001 2002 2003 2004 2005]';
y=[12.7627 12.8453 12.9277 12.9988 13.0756]'
X=[x1,x2,x3,x4]
abcde=regress(y,[X,ones(length(y),1)])
Y=[X,ones(length(y),1)]*abcde %验证
error=y-Y
结果:
abcde =
0.0277
-0.0239
0.0020
0.0758
-136.2619
Y =
12.7627
12.8453
12.9277
12.9988
13.0756
error =
1.0e-013 *
-0.5151
-0.0888
0.1243
-0.1776
-0.0888