REGRESS Multiple linear regression using least squares.
使用最小二乘法多元线性回归。
1. B = REGRESS(Y,X)
returns the vector B of regression coefficients in the linear model Y = X*B. X is an n-by-p design matrix, with rows corresponding to observations and columns to predictor variables. Y is an n-by-1 vector of response observations.
返回返回线性模型Y=X*B的拟合系数矢量B。X是一个设计的 n x p 的矩阵,它的行对应观测值,列对应预测值。Y是一个n x 1的观测的响应向量。
2. [B,BINT] = REGRESS(Y,X)
returns a matrix BINT of 95% confidence intervals for B.
返回一个矩阵BINT,代表着矩阵B 95%的置信区间。
3. [B,BINT,R] = REGRESS(Y,X)
returns a vector R of residuals.
返回残差矢量R
4. [B,BINT,R,RINT] = REGRESS(Y,X)
returns a matrix RINT of intervals that can be used to diagnose outliers. If RINT(i,:) does not contain zero, then the i-th residual is larger than would be expected, at the 5% significance level. This is evidence that the I-th observation is an outlier.
返回一个可以诊断异常值的区间--矩阵RINT,如果RINT的第 i 行没有0,那么第 i 行的残差比预期的5%的显著水品大。这证明 I 行观测值是离群的。
5. [B,BINT,R,RINT,STATS] = REGRESS(Y,X)
returns a vector STATS containing, in the following order, the R-square statistic, the F statistic and p value for the full model, and an estimate of the error variance.
返回一个矢量STATS依次包含:
6. [...] = REGRESS(Y,X,ALPHA)
uses a 100*(1-ALPHA)% confidence level to compute BINT, and a (100*ALPHA)% significance level to compute RINT.
使用100*(1-α)%的置信水平来计算BINT,使用100α%的
X should include a column of ones so that the model contains a constant term. The F statistic and p value 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 one minus the ratio of the error sum of squares to the total sum of squares. This value can be negative for models without a constant, which indicates that the model is not appropriate for the data.
If columns of X are linearly dependent, REGRESS sets the maximum possible number of elements of B to zero to obtain a "basic solution", and returns zeros in elements of BINT corresponding to the zero elements of B.
如果X的列都线性相关,REGRESS 将
REGRESS treats NaNs(Not a Number) in X or Y as missing values, and removes them.
拟合函数对于X或者Y里面的非数值的元素,认为他们是缺失的,并删除他们。