Skip to content

ENH: diagnostics for WLS, and WLS version of GLM #3743

Open

Description

@josef-pkt

(while looking at Stata's linktest #1479 documentation and our diagnostics)

two issues

  • weights in regression diagnostic auxiliary regression

    • I guess the OLS based auxiliary regression are consistent but not efficient if we have weights
    • variable addition or score tests would use the weights from WLS in the score equations
  • GLM has the WLS of the final step of the irls

    • I think it should work to use resid_working and weights to reconstruct a WLS that corresponds to the final local approximation, and we can use WLS based tests for diagnostics, variable addition, link/nonlinearity test
    • this would be different (?) but asymptotically equivalent to using conditional moment and score tests directly, or tests using resid_pearson.

Activity

  1. josef-pkt commented on Oct 11, 2017

    @josef-pkt
    MemberAuthor

    to the second main point above:
    PR #4021 adds the undocumented fit option attach_wls to attach the final WLS results to the GLMResults instance
    If reusing it works well, then we can add it a general option and make it available also with fit_gradient, or as a lazy cached attribute.

  2. added this to the 0.10 milestone on Oct 11, 2017
  3. josef-pkt commented on Oct 11, 2017

    @josef-pkt
    MemberAuthor

    see also #2050 Gauss-Newton Regression
    (I'm not sure yet which results we get with the different WLS local approximations.)

  4. josef-pkt commented on Jan 14, 2020

    @josef-pkt
    MemberAuthor

    specific to WLS:
    It looks to me like het_breuschpagan can be applied to wresid without changes, e.g. we can test whether there is heteroscedasticity left over, after using WLS to correct for some (parametric) heteroscedasticity.

    I'm not sure of what interpretation we get if we use wresid (based on var_weights) for other specification tests.
    e.g. acorr: We want to know if acorr is left in the residuals. In auxiliary regression we compare residuals at different lags. For auxiliary OLS, it would likely not make much sense to have wresid in endog and lagged wresid (based on different weights which are for other time points) in exog.
    Using resid in endog and exog and then using weights/WLS in an auxiliary regression might make more sense. e.g. acorr_breusch_godfrey
    acorr_breusch_godfrey has results instance as argument and takes results.resid. So user doesn't have a choice about which residuals are used.

    check literature, I don't remember those articles: heteroscedasticity robust tests for autocorrelation.
    Using cov_type in the auxiliary OLS regression is the easiest, but it doesn't take advantage of available var_weights.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions