MATLAB中5元一次方程:a*x+b*y+c*z+d*u+e*v=f.已知系数矩阵abcde和列向量f,用最小二乘法拟
0
0

1个回答

  • X=[2.5 25 62.5 6.25 625 21.25

    2.5 20 50 6.25 400 16.75

    2.5 50/3 125/3 6.25 2500/9 13.25

    2.5 100/7 250/7 6.25 10000/49 10.75

    2 25 50 4 625 20.75

    2 20 40 4 400 16

    2 50/3 100/3 4 2500/9 12.75

    2 100/7 200/7 4 10000/49 10.5

    5/3 20 100/3 25/9 400 15.75

    5/3 50/3 250/9 25/9 2500/9 12.5

    5/3 100/7 500/21 25/9 10000/49 10

    10/7 20 200/7 100/49 400 15.5

    10/7 50/3 500/21 100/49 2500/9 12

    10/7 100/7 1000/49 100/49 10000/49 9.5

    1.25 25 31.25 1.5625 625 18.75

    1.25 20 25 1.5625 400 12.75

    1.25 50/3 62.5/3 1.5625 2500/9 8

    1.25 100/7 120/7 1.5625 10000/49 1.75];

    Y=X(:,6);

    x=X(:,1:5);

    [B,BINT,R,RINT,STATS] =regress(Y,x);

    B,BINT,STATS

    rcoplot(R,RINT)

    Warning:R-square and the F statistic are not well-defined unless X has a column of

    ones.

    Type "help regress" for more information.

    > In regress at 162

    B =

    10.1988

    -0.8053

    0.0757

    -2.3178

    0.0435

    BINT =

    -10.9918 31.3893

    -2.8312 1.2205

    -0.4633 0.6148

    -7.8949 3.2592

    -0.0211 0.1081

    STATS =

    0.8551 18.3285 0.0000 4.2632

    ----------------------------------------------------

    REGRESS Multiple linear regression using least squares.

    regress采用的就是最小二乘法

    [x y z u v]=[10.1988 -0.8053 0.0757 -2.3178 0.0435]

    BINT 是置信区间