Skip to content

ENH: score_factor_obs for LEF and similar #1775

Open

Description

@josef-pkt

In many models the score_obs decompose into

f(u) * x

where u are the residuals u = y - fitted, and x are exog or instruments.
f(u) depends on y, x and parameters

suggestion: add score_factor = f(u) to Results or Model classes.

advantage: we can calculate new score for different x (or instruments z in IV)

Kevin used this for LM test in linear models, where f(u) = u

LEF/GLM have this structure, but it's not general enough for a base model

Activity

  1. josef-pkt commented on Oct 11, 2014

    @josef-pkt
    MemberAuthor

    The multiplicative part sf_i * x_i only depends on the linearity of the inner part of the predictor
    param = f(x * beta)
    and we can use score_factor and hessian_factor even if we don't have any additive residual defined.

    even more general:
    BetaRegression in PR #2030 has two components with two score_factor and 3 hessian_factor (hessian_factor is for 2 diagonal blocks and 1 off-diagonal block to calculate the hessian, after pre and post multiplying with the two exogs)

    Except for handling two score factors, everything else is the same, we can still get the full score and hessian from the restricted model just by knowing the exogs of the full model.

    However, I think, having the Hessian is not enough to get robust covariances for a robust score_test. I assume we need the sandwich form of the covariance of the score of the full model for this.

    edit

    It should be possible to get the sandwiches also without much changes, the function already takes optionally score and hessian.

  2. josef-pkt commented on Mar 9, 2016

    @josef-pkt
    MemberAuthor

    Stata 14 manual section 20.22 is explicit about when we have one or several score_factors for the decomposition.
    technical note at end lists some models where score_obs doesn't decompose into score_factors time exogs. Among them are nlogit, stcox and mixed.

  3. added this to the 0.10 milestone on May 26, 2018
  4. josef-pkt commented on May 26, 2018

    @josef-pkt
    MemberAuthor

    see #2107 for discrete, bumped for 0.10

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