class statsmodels.robust.robust_linear_model.RLM(endog, exog, M=<statsmodels.robust.norms.HuberT object>, missing='none', **kwargs)
[source]
Robust Linear Models
Estimate a robust linear model via iteratively reweighted least squares given a robust criterion estimator.
Parameters: |
|
---|
Attributes
df_model : float
df_resid : float
endog : array
endog
changes as well.exog : array
endog
changes as well.M : statsmodels.robust.norms.RobustNorm
nobs : float
pinv_wexog : array
normalized_cov_params : array
>>> import statsmodels.api as sm >>> data = sm.datasets.stackloss.load() >>> data.exog = sm.add_constant(data.exog) >>> rlm_model = sm.RLM(data.endog, data.exog, M=sm.robust.norms.HuberT())
>>> rlm_results = rlm_model.fit() >>> rlm_results.params array([ 0.82938433, 0.92606597, -0.12784672, -41.02649835]) >>> rlm_results.bse array([ 0.11100521, 0.30293016, 0.12864961, 9.79189854]) >>> rlm_results_HC2 = rlm_model.fit(cov="H2") >>> rlm_results_HC2.params array([ 0.82938433, 0.92606597, -0.12784672, -41.02649835]) >>> rlm_results_HC2.bse array([ 0.11945975, 0.32235497, 0.11796313, 9.08950419]) >>> mod = sm.RLM(data.endog, data.exog, M=sm.robust.norms.Hampel()) >>> rlm_hamp_hub = mod.fit(scale_est=sm.robust.scale.HuberScale()) >>> rlm_hamp_hub.params array([ 0.73175452, 1.25082038, -0.14794399, -40.27122257])
deviance (tmp_results) | Returns the (unnormalized) log-likelihood from the M estimator. |
fit ([maxiter, tol, scale_est, init, cov, …]) | Fits the model using iteratively reweighted least squares. |
from_formula (formula, data[, subset, drop_cols]) | Create a Model from a formula and dataframe. |
hessian (params) | The Hessian matrix of the model |
information (params) | Fisher information matrix of model |
initialize () | Initialize (possibly re-initialize) a Model instance. |
loglike (params) | Log-likelihood of model. |
predict (params[, exog]) | Return linear predicted values from a design matrix. |
score (params) | Score vector of model. |
endog_names | Names of endogenous variables |
exog_names | Names of exogenous variables |
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.robust.robust_linear_model.RLM.html