穩健線性模型

穩健線性模型,支援 範數 下列出的 M 估計量。

請參閱 模組參考 以取得指令和參數。

範例

# Load modules and data
In [1]: import statsmodels.api as sm

In [2]: data = sm.datasets.stackloss.load()

In [3]: data.exog = sm.add_constant(data.exog)

# Fit model and print summary
In [4]: rlm_model = sm.RLM(data.endog, data.exog, M=sm.robust.norms.HuberT())

In [5]: rlm_results = rlm_model.fit()

In [6]: print(rlm_results.params)
const       -41.026498
AIRFLOW       0.829384
WATERTEMP     0.926066
ACIDCONC     -0.127847
dtype: float64

詳細範例可以在這裡找到

技術文件

參考文獻

  • PJ Huber. ‘Robust Statistics’ John Wiley and Sons, Inc., New York. 1981.

  • PJ Huber. 1973, ‘The 1972 Wald Memorial Lectures: Robust Regression: Asymptotics, Conjectures, and Monte Carlo.’ The Annals of Statistics, 1.5, 799-821.

  • R Venables, B Ripley. ‘Modern Applied Statistics in S’ Springer, New York,

  • C Croux, PJ Rousseeuw, ‘Time-efficient algorithms for two highly robust estimators of scale’ Computational statistics. Physica, Heidelberg, 1992.

模組參考

模型類別

RLM(endog, exog[, M, missing])

穩健線性模型

模型結果

RLMResults(model, params, ...)

包含 RLM 結果的類別

範數

AndrewWave([a])

用於 M 估計的 Andrew 波形。

Hampel([a, b, c])

用於 M 估計的 Hampel 函數。

HuberT([t])

用於 M 估計的 Huber's T。

最小平方()

用於 M 估計的最小平方 rho 及其導函數。

MQuantileNorm(q, base_norm)

基於基礎範數的 M-分位數目標函數

RamsayE([a])

用於 M 估計的 Ramsay's Ea。

穩健範數()

用於穩健迴歸的範數的父類別。

TrimmedMean([c])

用於 M 估計的截尾平均數函數。

TukeyBiweight([c])

用於 M 估計的 Tukey 的雙權重函數。

estimate_location(a, scale[, norm, axis, ...])

使用 self.norm 和當前尺度估計量的位置 M 估計量。

尺度

Huber([c, tol, maxiter, norm])

用於聯合估計位置和尺度的 Huber 的提案 2。

HuberScale([d, tol, maxiter])

用於擬合穩健線性模型的 Huber 縮放。

mad(a[, c, axis, center])

陣列沿指定軸的中位數絕對偏差

hubers_scale

用於擬合穩健線性模型的 Huber 縮放。

iqr(a[, c, axis])

陣列沿指定軸的標準化四分位距

qn_scale(a[, c, axis])

計算尺度的 Qn 穩健估計量


上次更新:2024 年 10 月 03 日