Skip to content

general: use df_resid of results instance for inference #1203

Open

Description

@josef-pkt

we have df_resid in results and in models

e15f26b in #1189 also adjusts res.model.df_resid. This is not good, because we don't want to change the underlying model which can be attached to several robust covariance results instances

Instead we should change all methods in the Results classes that access model.df_resid to access the results df_resid instead.

One possible problem: results.df_resid is not defined for base.LikelihoodModel,
it's a cached attribute in RegressionResults
GLM and RLM set it as simple attribute in __init__
GenericLikelihoodModel also sets it in __init__

update: L1CountResults and similar L1xxxResults also modify .model.df_resid in the Results.__init__
also the same in GenericLikelihoodModelResults and ARResults

Do we have any stale state or state spill-over problems?

Activity

  1. josef-pkt commented on Nov 24, 2013

    @josef-pkt
    MemberAuthor

    a grep shows many usages of .model.df_resid across model areas.
    at least genmod and regression have unit tests for assert_equal(self.res1.model.df_resid, self.res2.df_resid) which will not hold anymore for results instances with some cluster robust covariances.

  2. josef-pkt commented on Nov 24, 2013

    @josef-pkt
    MemberAuthor

    update: there are actually not so many .model.df_resid outside of the unit tests and __init__.

    refactored in PR #1189
    I didn't change setting self.model.df_resid in L1xxxResults, GenericLikelihoodModelResults and ARResults

  3. jbrockmendel commented on Oct 5, 2017

    @jbrockmendel
    Contributor

    Partially addressed by #3949

  4. jbrockmendel commented on Oct 5, 2017

    @jbrockmendel
    Contributor

    Looks like the only remaining places this happens are in base.model and ar_model

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions