wxkdesky 发表于 2012-8-27 16:46

多元回归用matlab怎么算

多元回归用matlab怎么算呀?不会,有没有示例程序呀?包括求参数,求残差,求置信区间,最后怎么检验?

HNzhangjie 发表于 2012-8-27 17:17

额   我也需要

hzs2012 发表于 2012-8-27 19:23

给个实例,好点儿。。。意思是给个题目

hzs2012 发表于 2012-8-27 19:46

不需要例子的话,直接百度、google就好了。很多很多

liwenhui 发表于 2012-8-27 19:58

本帖最后由 liwenhui 于 2012-8-31 23:35 编辑

使用函数,regress(),具体调用方式见matlab的帮助。regress Multiple linear regression using least squares.
    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.

    = regress(Y,X) returns a matrix BINT of 95% confidence
    intervals for B.

    = regress(Y,X) returns a vector R of residuals.

    = 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.

    = 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.

    [...] = regress(Y,X,ALPHA) uses a 100*(1-ALPHA)% confidence level to
    compute BINT, and a (100*ALPHA)% significance level to compute RINT.

    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.

    regress treats NaNs in X or Y as missing values, and removes them.

秋leaves 发表于 2012-8-28 10:16

liwenhui 发表于 2012-8-27 19:58 static/image/common/back.gif
使用函数,regress(),具体调用方式见matlab的帮助。

regress Multiple linear regression using least  ...

果断有道翻译了一下

傻人招 发表于 2012-8-31 23:04

数据输入:x1=; x2=; y=;x=;回归、检验、预测:rstool(x,y,'purequadratic')   之后得到一个交互画面,给出两幅图形,左边是x2固定时的曲线y(x1)及其置信区间,右边是x1固定时的曲线y(x2)及其置信区间。假如X1为平均收入,x2为价格,y为商品需求量,改变X1或者X2,画面左边的‘predicted y’下方的数据就为对应的y值。  在画面左下方的下拉式菜单中选‘all’,则beta、rmse和residuals都传送到matlab工作区中,在matlab工作区中输入命令 beta,rmse就能得到结果了·~

蓝枫心叶 发表于 2012-9-1 09:02

呵呵,要是楼上的把它变成图文形式就更好了。。。
页: [1]
查看完整版本: 多元回归用matlab怎么算