Skip to content

ENH: Outlier robust estimation using weights #2873

Open

Description

@josef-pkt

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.

Activity

  1. josef-pkt commented on Mar 28, 2016

    @josef-pkt
    MemberAuthor

    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.

  2. josef-pkt commented on Mar 28, 2016

    @josef-pkt
    MemberAuthor

    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.

  3. Leoyzen commented on Apr 13, 2016

    @Leoyzen
    Contributor

    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?

  4. josef-pkt commented on Apr 13, 2016

    @josef-pkt
    MemberAuthor

    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.
  5. Leoyzen commented on Apr 14, 2016

    @Leoyzen
    Contributor

    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.

  6. Leoyzen commented on Apr 14, 2016

    @Leoyzen
    Contributor

    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:

    1. apply cleaning filter
    2. remove the outlier effect
    3. 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?

  7. josef-pkt commented on Apr 14, 2016

    @josef-pkt
    MemberAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions