You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: Outlier robust estimation using weights #2873
An idea for a new wrapper model when we have weights available in the estimation.
Use IRLS as in RLM on top of current MLE models.
e.g. a simple implementation would use an existing model and model class and repeatedly fit it with weights defined by the RLM norms (for outliers in endog or residuals) and similar weighting function for exog outliers, i.e. influental observations in x.
This could use a small maxiter in the inside optimization, or even maxiter=1 as in RLM, although that converges in one step.
More efficient implementation should reuse starting values, hessian, maybe one-step estimators. (or use BHHH style gradient WLS.)
two papers as starting point for search in GEE context:
Preisser, John S., and Bahjat F. Qaqish. 1999. “Robust Regression for Clustered Data with Application to Binary Responses.” Biometrics 55 (2): 574–79. doi:10.1111/j.0006-341X.1999.00574.x.
Lee, Donghwan, Youngjo Lee, Myunghee Cho Paik, and Michael G. Kenward. 2013. “Robust Inference Using Hierarchical Likelihood Approach for Heavy-Tailed Longitudinal Outcomes with Missing Data: An Alternative to Inverse Probability Weighted Generalized Estimating Equations.” Computational Statistics & Data Analysis 59 (March): 171–79. doi:10.1016/j.csda.2012.10.013.
Note: this is a bit similar to probability weights where we don't have an MLE interpretation, and the default cov_type should be HC.
I guess we should switch the default cov_type like Stata does for pweights.
new model attribute cov_type_default ? and if cov_type in fit is None, then use default, i.e. not always "nonrobust".
RLM, GEE and QuantileRegression already default to robust cov_type.
another reference, not read
information criteria with weighted likelihood (looks like we can use it even though it's QMLE)
Agostinelli, Claudio. 2002. “Robust Model Selection in Regression via Weighted Likelihood Methodology.” Statistics & Probability Letters 56 (3): 289–300. doi:10.1016/S0167-7152(01)00193-6.
I'm interesting in this robust model.My daily work is anomaly detection, and looking for some implement like ts-outlier .Any suggestion on what I may help?
Hi @Leoyzen
The time series outlier handling is more difficult, than the case with independent observations.
This issue needs the weights implementation as planned in #2879 for GLM.
There are two issues specific to tsa #943#2571 and more outlier issues that would partially apply to tsa.
What we need in general:
outlier detection: finding outlier candidates based on residuals (currently OLS/WLS only)
robust estimation: remove the effect of outliers for parameter estimation like RLM or other methods
robust prediction and forecasting: specific to tsa and similar, one of the explanatory variables like past observation could be an outlier that does or does not have an impact with a lag.
It's seems like the paper is which tsouliter based on.It shows that how to use OLS to estimate the outlier effect of the series and is more easy to implement.
Another word, to distinguish holiday/activity effect and outlier we may needs some tools to convert calendar (like pandas holiday calendar) to exog for statsmodels.
The idea is to estimate the impulse response weights of each outlier and then:
apply cleaning filter
remove the outlier effect
regression the outlier effect as exog
The third way is more general for our model which support exog regression.
I've already done some work about this.
The way how to implement to weight is how define the outlier AO/IO/TC effect function, is like the robust.norm or other suggestion?
@Leoyzen Please open a new issue about this. It's different from the weights option for independent data.
I read most of the Chen Liu article referenced in the tsoutliers documentation, but not yet Kaiser Maravall. The approach looks good and relatively simple in the estimator part (given that impact response functions for each outlier type are not estimated). However, much of the work is in the iterative procedure.
It would make a good PR, and I can look at the details if you want to discuss specifics.
Activity
josef-pkt commentedon Mar 28, 2016
Note: this is a bit similar to probability weights where we don't have an MLE interpretation, and the default cov_type should be HC.
I guess we should switch the default cov_type like Stata does for pweights.
new model attribute
cov_type_default? and ifcov_typeinfitis None, then use default, i.e. not always "nonrobust".RLM, GEE and QuantileRegression already default to robust cov_type.
josef-pkt commentedon Mar 28, 2016
another reference, not read
information criteria with weighted likelihood (looks like we can use it even though it's QMLE)
Agostinelli, Claudio. 2002. “Robust Model Selection in Regression via Weighted Likelihood Methodology.” Statistics & Probability Letters 56 (3): 289–300. doi:10.1016/S0167-7152(01)00193-6.
Leoyzen commentedon Apr 13, 2016
I'm interesting in this robust model.My daily work is anomaly detection, and looking for some implement like ts-outlier .Any suggestion on what I may help?
josef-pkt commentedon Apr 13, 2016
Hi @Leoyzen
The time series outlier handling is more difficult, than the case with independent observations.
This issue needs the weights implementation as planned in #2879 for GLM.
There are two issues specific to tsa #943 #2571 and more
outlierissues that would partially apply to tsa.What we need in general:
Leoyzen commentedon Apr 14, 2016
I've already read the reference of 'Seasonal outliers in time series. R Kaiser'.
http://www.bde.es/f/webbde/SES/servicio/Programas_estadisticos_y_econometricos/Trabajos_sobre_programas/ficheros_Regresion/slsoutlier.pdf
It's seems like the paper is which tsouliter based on.It shows that how to use OLS to estimate the outlier effect of the series and is more easy to implement.
Another word, to distinguish holiday/activity effect and outlier we may needs some tools to convert calendar (like pandas holiday calendar) to exog for statsmodels.
Leoyzen commentedon Apr 14, 2016
Here's the idea related to this topic.
http://stats.stackexchange.com/questions/104882/detecting-outliers-in-time-series-ls-ao-tc-using-tsoutliers-package-in-r-how
The idea is to estimate the impulse response weights of each outlier and then:
The third way is more general for our model which support exog regression.
I've already done some work about this.
The way how to implement to weight is how define the outlier AO/IO/TC effect function, is like the robust.norm or other suggestion?
josef-pkt commentedon Apr 14, 2016
@Leoyzen Please open a new issue about this. It's different from the weights option for independent data.
I read most of the Chen Liu article referenced in the tsoutliers documentation, but not yet Kaiser Maravall. The approach looks good and relatively simple in the estimator part (given that impact response functions for each outlier type are not estimated). However, much of the work is in the iterative procedure.
It would make a good PR, and I can look at the details if you want to discuss specifics.