Skip to content

BUG: BetaModel, df_xxx warning, and init kwargs #8779

Closed

Description

@josef-pkt

Simple example without specifying exog_precision produces a warning
UserWarning: df_model + k_constant + k_extra differs from k_params

Also, I misspelled exog_precision and did not get an exception. Silently ignored.
__init__ does not check whether kwargs are valid

Activity

  1. added this to the 0.14 milestone on Apr 7, 2023
  2. josef-pkt commented on Apr 7, 2023

    @josef-pkt
    MemberAuthor

    That's weird

    Part of this issue looks like duplicate of #7569

    BetaModel does have _init_keys added in #7543
    maybe there is a missing call to the check method

    update
    Those are two different usages of init_keys.
    #7569 refers to replicating the model, creating a new model with the same arguments.
    #7741 is the check for invalid kwargs in __init__

    BetaModel has the former init_keys, but not applied to the kwargs issue.

    I don't see it right now, is _init_keys enough or do we need to set kwargs_allowed additionally?
    AFAIR, init keys should be enough, but I don't see the code yet.

  3. josef-pkt commented on Apr 7, 2023

    @josef-pkt
    MemberAuthor

    strange: I don't get the df_model, ... k_params mismatch warning anymore in my notebook
    all values look correct
    ???

    about allowed keys:
    BetaModel uses kwds['extra_params_names'] = extra_names before the super call to add the extra names for the precision parameters. (AFAIR, this also sets the df_model, df_resid)
    'extra_params_names' is not listed in the allowed keywords.
    In my planned change, I delete it again from the kwargs/kwds before calling check_kwargs
    There is no option for users to use 'extra_params_names' as __init__ argument, it's hard coded.

    Aside: wrong name: kwargs are called kwds here. "kwds" should be only used for dict keywords like cov_kwds.

  4. added a commit that references this issue on Apr 7, 2023
    37ddfaf
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions