matlab中的M-estimator-robust regression

Robust regression(穩健迴歸)

函數:

robustfit

語法:
b=robustfit(X,y)
b=robustfit(X,y,wfun,tune)
b=robustfit(X,y,wfun,tune,const)
[b,stats]=robustfit(...)

描述
b=robustfit(X,y)通過執行穩健迴歸來估計線性模型y=Xb,並返回一個由迴歸係數組成的向量b。X是一個n*p預測變量矩陣,y是一個n*1觀測向量。計算使用的方法是加上bisquare加權函數的迭代重加權最小二乘法。默認的情況下,robustfit函數把全1的一個列向量添加進X中,此列向量與b中第一個元素的常數項對應。注意不能直接對X添加一個全1的列向量。可以在下面的第三個描述中通過改變變量“const”來更改robustfit函數的操作。robustfit函數把X或y中的NaNs作爲一個缺省值,接着把它刪除。
b=robustfit(X,y,wfun,tune)增加了一個加權函數“wfun”和常數“tune”。“tune”是一個調節常數,其在計算權重之前被分成殘差向量,如果“wfun”被指定爲一個函數,那麼“tune”是必不可少的。權重函數“wfun”可以爲下表中的任何一個權重函數:


如果“tune”未被指定,那麼其默認值爲表中對應值。“wfun”也可以是一個把殘差向量作爲輸入,併產生一個權重向量作爲輸出的函數。通過標準誤差估計和調節參數來調整殘差。“wfun”可以用@(@wyfun)。
b=robustfit(X,y,wfun,tune,const)增加一個“const”控制模式內是否包含一個常數項,默認爲包含(on)。
[b,stats]=robustfit(...)返回一個包含一下域的STATS結構。
'ols_s'    sigma estimate (rmse) from least squares fit
        'robust_s'   robust estimate of sigma
        'mad_s'     MAD estimate of sigma; used for scaling
                    residuals during the iterative fitting
        's'         final estimate of sigma, the larger of robust_s
                    and a weighted average of ols_s and robust_s
        'se'         standard error of coefficient estimates
        't'         ratio of b to stats.se
        'p'         p-values for stats.t
        'covb'       estimated covariance matrix for coefficient estimates
        'coeffcorr' estimated correlation of coefficient estimates
        'w'         vector of weights for robust fit
        'h'         vector of leverage values for least squares fit
        'dfe'       degrees of freedom for error
        'R'         R factor in QR decomposition of X matrix
The ROBUSTFIT function estimates the variance-covariance matrix of the coefficient estimates as V=inv(X'*X)*STATS.S^2.  The standard errors and correlations are derived from V.

http://blog.csdn.net/meng4411yu/article/details/8851187 博客中有應用例子

http://blog.csdn.net/abcjennifer/article/details/7449435 博客中有M-估計的原理介紹

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章