Skip to content

REF: add cov_type robust covariance to fit method #1418

Open

Description

@josef-pkt

https://github.com/josef-pkt/statsmodels/tree/REF_covtype_fit

misc notes:

  • wls_prediction_std needs to be added to unit tests for robust cov.
    after the first commit, I have a scale that is much too large. I only saw it because the confidence intervals in regression_plots.plot_fit looked too wide.
  • also wls_prediction_std needs to be checked that it uses the robust cov

Activity

  1. josef-pkt commented on Feb 24, 2014

    @josef-pkt
    MemberAuthor

    To the first point above: There is a fragile structure in cov_type='cluster' because I overwrite df_resid to be the number of groups. Following Stata the asymptotics is with respect to the number of groups keeping the other dimension fixed.
    This causes a bug in scale if Results instance is adjusted in fit, because the scale method uses the results.df_resid and not the results.model.df_resid. The latter is unchanged.

    I could switch scale to use model.df_resid, but the whole thing looks a bit fragile.

  2. josef-pkt commented on Feb 24, 2014

    @josef-pkt
    MemberAuthor

    related messy structure: we have scale as argument to RegressionResult.__init__, but then it is still overwritten by the method (cached attribute). I don't find an issue where I mentioned this before.

  3. josef-pkt commented on Feb 24, 2014

    @josef-pkt
    MemberAuthor

    For cluster we need to separate those methods where df_resid is adjusted to be ngroups and where it is the original. If I don't adjust results.df_resid, then I have test failures in at least conf_int, ttest and fvalue.

    additional cached attributes that use df_resid, but most likely don't have test coverage for robust cov are rsquared_adj and msresid, maybe there are more.

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