最小二乘拟合,我看书上是用 polyfit 和 regress 。 下面是regress的help说明,但里面却只是显示了 R 和F 统计量,那么 t 统计量如何显示,请高人指点,谢谢了!
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.
[此贴子已经被作者于2008-4-30 4:57:44编辑过]