MATLAB中怎么用最小二乘估计求经验回归方程?题中只给了X,Y值.

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/20 16:39:42

MATLAB中怎么用最小二乘估计求经验回归方程?
题中只给了X,Y值.

列出X、Y的值,看看到底符合什么模型.

>> help regress
REGRESS Multiple linear regression using least squares.
b = REGRESS(y,X) returns the vector of regression coefficients, b,
in the linear model y = Xb, (X is an nx...

全部展开

>> help regress
REGRESS Multiple linear regression using least squares.
b = REGRESS(y,X) returns the vector of regression coefficients, b,
in the linear model y = Xb, (X is an nxp matrix, y is the nx1
vector of observations).

[B,BINT,R,RINT,STATS] = REGRESS(y,X,alpha) uses the input, ALPHA
to calculate 100(1 - ALPHA) confidence intervals for B and the
residual vector, R, in BINT and RINT respectively. The vector
STATS contains the R-square statistic along with the F and p
values for the regression.

The X matrix should include a column of ones so that the model
contains a constant term. The F and p values are computed under
the assumption that the model contains a constant term, and they
are not correct for models without a constant. The R-square
value is the ratio of the regression sum of squares to the
total sum of squares.

收起