Skip to content

Naming of weights argument in WLS #3891

Open

Description

@kshedden

Should we migrate the weights argument of WLS to be named freq_weights, like in GLM? If so, what is the best path for doing that?

@jarvmiller

Activity

  1. josef-pkt commented on Aug 28, 2017

    @josef-pkt
    Member

    No, weights in WLS are var_weights. That's how they are specified for llf and scale. We changed this so that (inverse of) weights are equivalent to a diagonal covariance/sigma matrix
    It's just that for params and cov_params, or any quadratic forms, the definition and interpretation of weights doesn't matter.
    Also nobs and df_resid are defined by number of rows and not by weights.

  2. kshedden commented on Aug 28, 2017

    @kshedden
    ContributorAuthor

    So should we have a separate freq_weights argument for WLS? The issue is that the survey code expects a freq_weights argument in the model initializer. Right now we have to test which model class we are in and adjust accordingly.

  3. josef-pkt commented on Aug 28, 2017

    @josef-pkt
    Member

    I think special casing WLS in the survey method would be better for now until we have a clean solution.
    Adding freq_weights to OLS/WLS is not completely trivial for all the extra results and methods. It shouldn't be very difficult, but will require a large number of unit tests and most likely that we carry around both freq_weights and var_weights in several methods.

    I would prefer to wait changing OLS/WLS until we have settled on the design and definitions in GLM, e.g. #3856 is still open and the sandwich cov_types are not fully supported yet for freq_weights.

    It would be possible to add freq_weights to WLS as alias for weights with a big warning to users that it is not really supported. If freq_weights in OLS/WLS are released in 0.10, there would be time to implement it properly at least for most results.

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